Intellij java editor: how to keep two files for editing - intellij-idea

Intellij java editor: how to keep two files for editing? For example, editing file foo.java and bar.java. When selecting foo.jar from the drop down list, the tab for bar.java disappear. When selecting bar.jar from the drop down list, the tab for foo.java disappear. How to make both tabs(foo.java and bar.java) visible at the same time?

You can split the editor horizontally or vertically from the editor tab context menu to make multiple tabs visible at the same time.

Related

IntelliJ/WebStorm: Split editor so that splits stay together

I would like to split a tab (either horizontally or vertically) so that there is still only one tab for that file so that when I switch to other tab or file, those panes will go away but when I come back to the file, panes show up (similar to how Eclipse works).
Currently when I split tab, those two tabs are completely detached so that when I go to other file in one group, split tab still stays put in other group.

Zerobrane hotkeys to jump between editor tabs and other panes within IDE

Using Zerobrane, are there any defined hotkeys or keymaps that will jump between panes within the IDE? Like, some key to jump between several files open as tabs (jump between tabs). Another is jumping from editor tab pane over to the project pane, etc...
To jump between tabs you can you Ctrl-PgUp/PgDn or Ctrl-(Shift-)Tab. Also, Ctrl-P will open a command panel with the list of currently open files, and after selecting a file from the list press Enter to jump to the tab with that file.
Jumping to Project tab and Console is not available, but moving between tabs there can be done using the same Ctrl-PgUp/PgDn combination. I'll consider adding some hotkey to move between open panes.
Update 7/13: Something like this may work as a simple workaround (add to the IDE config file as Edit > Preferences > Settings: User):
ide:SetHotKey(function()ide:GetProjectTree():SetFocus()end, "Ctrl-Alt-P")
ide:SetHotKey(function()ide:GetOutlineTree():SetFocus()end, "Ctrl-Alt-O")
Other panes (Output/GetOutput(), Console/GetConsole(), etc.) can be done in a similar way.

VSCode shortcut for move open editor up / down (not group but open editor)

I don't mean move editor group or viewed file (split editor groups); -- but in the list of open editors in the sidebar.
They can be rearranged by mouse-dragging them into desired position. Can't find the name for shortcut command, if it exists.
For clarity, attaching a screenshot: (it's unfortunately way too large)
Use case is rearranging open editors according to some flow (of data, functions or whatever) to simplify thinking about it.
Thanks!
I do not see any command that would allow you to re-order the Open Editors list directly.
But the order of that list is determined by the order of your opened tabs, so if you move the file tabs around the Open Editors list changes to match. So these would do what you want:
Move Editor Left: Ctrl+Shift+PageUp
Move Editor Right: Ctrl+Shift+PageDown
This works even if you have the setting Editor: Show Tabs disabled so that only a single tab is displayed - you can still move that tab left and right and that is reflected in the Open Editors list!!

Show a most recently used tab after dragging a tab in IntelliJ IDEA

In IntelliJ IDEA, I want to show a most recently used tab after dragging a tab like eclipse. For example,
a.java
b.java
c.java(Current)
...
d.java(Previous) -- hidden by dropdown
In case 'c.java' was dragged, the editor shows 'a.java' instead of 'd.java'.
I want it to behave same as 'Activate most recently opened' setting for closing tabs. But it doesn't work for dragging in case the previous tab is hidden by a dropdown menu. Is there any setting for it?
No, there is no setting for it.

Intellij - Split Screen Creates Duplicate

When I have two Java files, and I want to compare them side-by-side, I split them vertically. However, I end up with 3 Java files, because it duplicates the one I split, instead of just moving it.
Is there a way to change the behavior such that it just splits the two files I have open, rather than creating a 3rd?
Not sure when this feature was added, but you can simply right-click the tab and choose Move Right ; it has the effect of splitting horizontally and then closing the old tab.
This is not possible. The concept of a split is just that, to split an editor. See Splitting and Unsplitting Editor Window in the help guide. You can create a second editor window by dragging a tab off the main editor window. See Detaching Editor Tabs in the help guide. Note, if you already have a split in place, you can drag a file from one split pane to the other.
You can also write a macro to accomplish what you want.
Give the tab you want to split focus
From the menu: Edit > Macros > Start Macro Recording
Record the following sequence:
Right click on the tab and split it
Type ctrl+F4 (or ⌘F4) to close the original window
Stop the macro (either view the popup in the bottom or via the Edit > Macros > Stop Macro Recording)
In the dialog, give the macro a name.
You can now either run the macro from File > Edit > Macros, or you can map a keyboard shortcut to it. See Binding Macros with Keyboard Shortcuts in the help guide for how to do such.
Don't use Split Vertically or Split Horizontally actions!
Instead, you can use Split and Move Right and Split and Move Down actions.
You can press Ctrl + Shift + A, and type "split ..." then choose the action.
Also, you could add shortcuts for them,