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

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!!

Related

How to copy search results in IntelliJ to paste them elsewhere?

I would like to remember my team the ports used for debugging, for several projects.
A Ctrl-F in a directory, and I have my results under IntelliJ_2021.1.3 Ultimate I'm using,
but I have no way to paste them, like they are on this window, either with Ctrl-C or Ctrl-Ins , on another location in order to send a mail to my teammates.
Does a workaround exist, or has this feature been implemented in a later version I should try to upgrade to?
I don't think there is a simple and direct way to do what you want. However, there is a workaround:
Run your search, and then from the Find in Files window click the Open in Find Window button:
Right-click anywhere within that Find window listing the occurrences, then select Export to Text File from the context menu:
An Export Preview window will open, showing the search results in expanded hierarchical form, reflecting the structure under the directory you searched. Within that window you can select any contiguous portion of text, then right click and select Copy from the context menu:
You can then paste the selected text into any other window, and massage the results as necessary:
Notes:
This is only a workaround because unfortunately I don't see a way to directly copy the results in your screen shot, in which each line shows a both a search occurrence and its file location. That information is still in the copied text, but it may take a bit of effort to get it in the form you want.
The Copy button in the Export Preview window ignores any text selection and blindly copies everything, so use Copy from the context menu instead if selecting a subset of the text.
I used IntelliJ IDEA 2023.1 EAP (Ultimate Edition). I don't know whether this functionality exists in your version.

How can I see multiple tabs in IntelliJ?

The situation is when I open some files it isn't added on editor tab(red box).
The file that I double-clicked is located in green box with replacing existing file.
problem on editor tab in intellij
I want to see multiple tabs in editor tab in IntelliJ.
But I can see just only one tab like below.
I try to look around settings - Editor - General - Editor tab. But I couldn't find answer.
I wish I could get a hint here. Thank you.
Click on gear on the right -> view options -> Open in a new tab

Shortcut for opening the definition file in a split vertical group in vscode

Are there any shortcuts to open the definition (e.g.: a method definition) in a split vertical group? By ctrl + click on the usage of method, it opens in a new tab. It bothers me, because I have to leave my own tab.
(I know that after opening in a new tab, by pressing ctrl + \ it will be open it in a new group, but this also has the same problem: I lose my own tab, and a second problem: when I want to close the definition file, I have to close it from both the 2nd group and the 1st group.)
Are there any shortcuts to open the definition file directly in a new group?
Ctrl+Alt+Click seems to open the definiton file in a split editor.
It'll open to whatever you have this setting:
Workbench > Editor: Open Side By Side Direction // options are right and down
Note that it'll directly open the definiton file in a split editor only if there is a single possible defintion file. For example, you may have both a source and a dist folder with the same files in them (after some task runner commands perhaps). If there is more than one option, vscode will instead open a peek window with the multiple references listed to the right side. You can Ctrl+Click on whichever of those you want to open to the side.

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,