IntelliJ/WebStorm: Split editor so that splits stay together - intellij-idea

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.

Related

Can IntelliJ IDEA editor tabs be split without leaving a copy in the original tab?

In IntelliJ IDEA, is there a way with splitting editor tabs (split vertically/horizontally regardless) to just send a particular file to a newly split tab without leaving a copy in the original tab? (that I then have to close each time)
I work a lot with splitting editor tabs and it's a waste of time and focus that for every new split I have to also close the old tab (99,9% of time I use one tab per file).
It would be great to know if there already is a way to do what I want so I can use it or prepare a feature request.. or write a plug-in :>
Cheerio!
Use the Split and Move Right/Down actions in the editor tab context menu:

Intellij java editor: how to keep two files for editing

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.

Why Intellij Idea doesn't show the current file?

My current file is ServletConfig, but it can't show on the top of the tabs when there are many tabs.
By default, the IDE adds new tabs to the right of active tabs. If the space exceeds the screen width, new tabs collapses behind the "show all"-button. This is the behavior you're expecting. New Tabs just collapses behind the "show all".
You have two options, disable the collapse-mechanism (eventually resulting in tiny tab headers that are not useful as well) or close least used tabs automatically. There is no "always show last opened Tab".
Check the Editor-Tab Documentation to check if a setting fits your need.

how to open a file in two split windows?

I split the editor
and I want to show the file in the both sides of the editor,
most probably this is too easy but I can't find how to do that,
edit:
I find a way, I close all other files, and keep only the target file, and then I split the editor. now phpstorm will show the file in both windows. and then I reopen other files. but I don't think this is smart. Probably there is a better way.
thank you
In general: to split current tab in editor:
Right click on editor tab
choose Split Horizontally or Split Vertically
you can also use Move Down or Move Right -- but this will move editor tab into new split instead of "copying" it.
Let's assume you have this setup (notice "test.php" is already located in both splits):
Now you want to have "css.css" to be in both splits as well. Depends on your IDE version you will have 2 choices:
1) Split this file -- you will have 3 splits now:
Using mouse move "css.css" from newly created split into existing split:
2) Use Open in Opposite Group action
In newest version (my 2021.2) found this option here:
Window -> Editor Tabs -> Split Right/Split Down

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,