How to Open Multiple Windows / Views Viewing the Same File/ Project?
Dear gentle, kind, empathetic, generous, helpful reader,
I am trying to do something very basic and fundamental which is to open the same file in multiple windows or the same project (preferably in multiple windows).
I can't believe there is no such option to do that in IntelliJIdea. It was easy to do in Eclipse (New Window option is right there in the menu and the entire project opens so).
I am frankly disappointed with my version of IntelliJIdea Ultimate. I downloaded it because I wanted software engineer metrics and code analysis and UML diagram representation . The UML diagram representation is not at all usable (there is no drilling down from packages to parent classes). I have not tried the software engineering metrics / analytics tool because I can barely import the code from Eclipse.
The most unbelievable thing is that now my copy of Eclipse 4.7 (and older version 4.4) will not start (I am trying to debug it in the eclipse forums). This has caused me hours of delay and lost productivity.
I was hoping to run both the editors and take advantage of the features in one which the other does not have . Netbeans and eclipse work so well together- what is up with intellij idea ? This is really disappointing.
Please sign in to leave a comment.
You can split the editor view vertically/horizontally, this will display the same file in both splits, then you can drag one of the tabs outside of the IDE to create a float editor window.
Another way to open multiple editors for the same file is to select the file in the Project view and press Shift+Enter.
> Serge Baranov Created Today at 15:58 You can split the editor view vertically/horizontally, this will display the same file in both splits, then you can drag one of the tabs outside of the IDE to create a float editor window.
Alright, it seems we may have some miscommunication again and it is probably once again my fault . I was not clear.
I would like to open a file called Class X in two separate windows . I would like one window to have Class X displayed in one monitor (I will be dragging it to that monitor) and in the other window I will be dragging the editor to I will have the same Class X showing. So two windows , separate windows , on two different monitors viewing the same file. This is very straightforward to do in eclipse and pretty much every other editor I know. I am unsure why it is so non intuitive or the menus don't contain any such commands for intelliJ. But I am new so I am willing to learn.
Thanks again and I hope this was more specific and clearer? If not feel free to ask Sir.
Shift+Enter does exactly this, press it twice on a file in the project view and you will have 2 editors open with the same file that you can move to different monitors:
Shift+Enter works the same as Shift+F4.
https://www.jetbrains.com/help/idea/using-code-editor.html
You can also use Alt+mouse.
> Shift+Enter works the same as Shift+F4.
Thanks! this was not in any of the forums and it took some effort to figure this out even after reading your message. When I press shift + enter I do get it to detach from the main but I can't return the tab to the main. Also shift + enter usually ends up creating a lot of new lines in the class file I am trying to detach from the main.
Sorry for so many questions , I am also have a migraine for some reason.
I can move the window out of the main editor window but I cannot have one window open in the main editor and one window open in the other screen (both windows opening the same class).
I tried using "alt + mouse" and "shift + f4' and trying to use the mouse to drag it back to the "main window" and it does not seem to be working.
Sorry but just navigating so ought not to be so difficult. the commands come after the user becomes familiar with menu items ...
The focus must be on the file in the project view, not in the editor.
> The focus must be on the file in the project view, not in the editor.
Ok that was helpful.
I can now open the file with ease by using shift + enter (after I have the focus on the file in the project window).
I still cannot return the opened window with the class file to the main window .
I cant seem to restore it to the tabs to the main window.
This is embarrassing because this is a basic navigational thing. Is there a youtube video demonstrating this?
This can be done by dragging the editor tab to the main window tab bar. Depending on the IDE settings, you may need to hold Alt key for the drag&drop to work.
> This can be done by dragging the editor tab to the main window tab bar. Depending on the IDE settings, you may need to hold Alt key for the drag&drop to work.
Ok the key word is 'tab' I was able to move the popup window back into the main window by clicking on the tab (the class name / file name to be precise).
That was an important detail. Thank you for helping me figure these basics out..
Thanks Serge.
Shift+Enter was really amazing, it's very useful when we want to edit same file with two places
Shift+Enter is useful, and yet it only provides an editor window - without any of the accompanying tool windows (Project Explorer, Structure, Version Control, what-have-you). In contrast, Eclipse can duplicate proper, full project windows containing everything. This is invaluable when doing complicated refactorings.
Are there any plans to get this functionality into IDEA? Or should I just go back to Eclipse when things get tough?
@Hmijail
You can move every window such as Project Explorer, Structure or Version Control to the separate window. Click "Options | View mode | Window" for that:
But I don't want to move the tool windows, I want to duplicate them. For example, for the case of the Project Explorer: I want to explore the full project in 2 independent windows, and use each explorer to open independent editors.
The only solution here is to run 2 different versions of IntelliJ IDEA. See the related YouTrack item:
https://youtrack.jetbrains.com/issue/IDEABKL-5934
I see that that YouTrack item and linked issues are 9 years old and still pending :(((
And even if I go the hackish way and managed to open both, would the 2 IDEAs be able to open the same settings files from 2 different processes? Or will one trash the changes written by the other? Sounds risky!
@Hmijail
I double-checked it. It's not possible, unfortunately, only one instance of a tool window is possible.
Right click the tab and select split vertically
Most JetBrains products have this by right-clicking on the open file (tab) and then select Split Down as shown below
I hope this helps.