Move file from one editor window to another (split mode)

10.2k views Asked by At

Is it possible to move a file (already opened) from one editor to another in split mode without using mouse and without using tabs (I have tabs disabled).

Example of what i want to accomplish. I enabled split mode (vertical) and opened file X in left editor. I want to move this file X to right editor because I already have file Y int left editor.

I found the command Move to opposite group which works fine only when tabs are enabled. When tabs are disabled (my case) call Move to opposite group force split mode to disappear.

5

There are 5 answers

0
MyDogTom On BEST ANSWER

Action Open in opposite group is the closest solution I found.

Example of what i want to accomplish. I enabled split mode (vertical) and opened file X in left editor. I want to move this file X to right editor because I already have file Y int left editor.

After Open in opposite group action X will be opened in both editors. My workflow is "move" X to right editor and keep working in left editor.

2
Daveloper On
  • Goto File->Settings
  • Then Keymap
  • Type in the searchbox "Move To Opposite Group"
  • Assign a shortcut

Also useful is "Goto Next Splitter" which allows you to switch between your Splitter.

But you'll hardly find a shortcut which is not already occupied.

I used Ctrl + NumPad+ for "Move To Opposite Group" and Ctrl + ArrowRight for "Goto Next Splitter"

You'll be notified that this shortcut is already in use, but you can ignore that. I had no conflicts so far

0
Michael On

Here is another way to do this:

  1. Put the cursor in the editor you want the class to display in
  2. Bring up the search for class dialog (alt-o in my mac keymap, can't remember if I customized this or not)
  3. Search for your class
  4. Select it then hit cmd-shift-enter, it will open in the editor your cursor is in even if it is already open in another editor pane
0
Nate Johnson On

I agree with David Viehtauer and would add to his setup. This also won't work with tabs disabled, but has become essential to my workflow.

My prefered setup under Preferences > Keymap:


Move Right: ⌃ + ⌘ + ↓
Move To Opposite Group: ⌃ + ⌘ + ↑
Goto Next Splitter: ⌃ + ⌘ + →
Goto Previous Splitter: ⌃ + ⌘ + ←


Move Right will create a new splitter and send your current tab to it (if you have more than one tab on your current splitter). Once your file is in a new splitter you can go between your splitters with the Goto Next Splitter and Goto Previous Splitter shorcuts above. Now, using the Move To Opposite Group shortcut you can move your active tab to the preferred side.

Once you get familiar with this setup, you can quickly manage your tabs.

2
Marco Faustinelli On

My choice in this case was to use CTRL-SHIFT-a. I felt the command was not important enough to dedicate a shortcut to it.

As soon as the dialog appears, it is sufficient to type open opp and then you can already hit ENTER.