Keyboard shortcut to switch between horizontally split windows in Intellij - intellij-idea

I've done numerous searches to find out how to switch between two files that are horizontally split but can't seem to find it. I know that you can switch between vertically split files by using the Goto Next Splitter option, but there doesn't seem to exist an option for horizontally split. Has anyone else figured this out? Thanks!
An example of a situation where I can't switch between the top and bottom files:

I just tried this out, and Goto Next Splitter (Option-Tab on mac) works just fine for me on horizontally split panes
Note: Using CLion 2017.1.2
If you have IdeaVim installed, you can use the Control-W - J/K command to switch between Vim split panes. See also How do I switch between panes in split mode in Vim?

Use Ctrl + Tab or Ctrl + Shift + Tab to switch between opened buffers (or "file editors", if you like). If you have only two buffers like on your screenshot, you can just press Ctrl + Tab and then by pressing Enter the other editor will become focused.
Important addition:
The shortcut varies depending on your keymap. To figure out proper key combination, open File -> Settings -> Keymap and search for "Switcher" keymap in the search field.

Related

Can I open a file in a new split screen tab with a keyboard shortcut in IntelliJ?

In VS Code I can press command + P to search for files and then when I find the one I'm looking for I can press Command + Shift + Enter to open the file in a new tab that adds a split pane to the window.
I can browse in a similar way in IntelliJ pressing Shift twice, but I can't figure out how to open the file in a tab in a split pane, just in a new tab in the same pane on pressing Enter. Is there a way to do it?
On the tab line, where all of your files are tabbed and opened, you can right click and see the option Split Vertically and Split Horizontally. They will split your window as needed. You can bind these options to a macro and automatically have anything split in a second.
Then you can just open any file with your explorer, and then run your key combination to split it!
Edit: you can create key mapping from the Settings -> Keymap menu.
Mr. Robot
I think, it's too late to answer this question.
But anyways, there is already a predefined keymap binding as per your requirement to open a new file in a split window.
keymap is Shift + Enter
After searching any file, you just have to press this combination and it will open that new file in a split window.
*This keymap is for Mac, it may be different for other OS.

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

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.
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
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.
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.
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.
Here is another way to do this:
Put the cursor in the editor you want the class to display in
Bring up the search for class dialog (alt-o in my mac keymap, can't
remember if I customized this or not)
Search for your class
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

Cycle through autocomplete suggestions without arrows

I'm really impressed with the autocomplete feature of the IntelliJ IDE so far.
What I'd like to do, is cycle through the autocomplete suggestions I get when hitting Ctrl + Space without using the arrow keys (↑, ↓).
The reason for this is that I prefer to keep my fingers on the home row (I'm using IntelliJ's Vim emulator additionally).
For example, how would I select sortThis instead of sorted without using the arrow keys or the mouse?
Peter Gromov's answer brought me to a satisfying solution:
In IntelliJ's settings, for Keymap → Editor Actions → Down I set a custom shortcut: Ctrl + J.
This way I can cycle forward through the suggestions.
Setting a shortcut for Down with Selection or Scroll Line Down in the IdeaVim-specific shortcuts did not affect the selection of autocomplete suggestions though.
The answer here: https://stackoverflow.com/a/9713306/2370679 led me to discover that Ctrl+n & Ctrl+p allow navigation of the auto-complete options without having to modify any settings
For macOS the IDE will give a hint that "^↑ and ^↓ will move caret up and down in the editor". These clearly do not work.
There are a few extra steps that are needed after following #matthias-braun's solution.
Here is the full list of step that I use:
Go to Preferences -> Keymap
Expand Editor Actions (not Plug-ins -> IdeaVim)
Select Down
Click the pencil icon or right-click
Select Add Keyboard Shortcut
Press the shortcut (I use ^N)*
Repeat for 3-6 for Up (I use ^P)
Click Ok**
Go to Preferences -> Other Settings -> Vim Emulation
In the drop-down under the Handler column for the row containing Down, select Vim***
Do the same thing for Up
* If you are warned about the key binding already existing then remove it. You can always reset back to the defaults by clicking the little cog icon up the very top to the right of the drop-down menu.
** The Vim Emulation doesn't seem to be populated correctly until you reopen the Preferences.
*** I'm not sure why the Handler should be Vim. This seems backwards to me but it works.
If you're able to scroll up/down in editor with some IdeaVIM-specific shortcuts, they should also work in the completion list.
In this particular case, I'd just type another "t" so that "sortThis" becomes selected (and the only) variant.
I have done the same thing with mapping the arrows but in a more logical way:
I mapped them that when I press 'Alt' 'J' is left, 'L' is right, 'I' is up, and 'k' is down. that way I can have easy access to the arrows while my fingers are on the home row and I don't need to move them nearly as much...
I'm posting it just so people who search it on google can have that idea.

How can I expand multi-line selection to full lines in PHPStorm?

In Sublime Text I can arbitrarily select a set of lines and then use ⌘+L to expand the selection to the full lines. Is there a similar command in PHPStorm / WebStorm? (I'd like to map that command to a keyboard shortcut.)
I know PHPStorm has the option "Select Line at Caret", but that selects only one line.
Update
Nowadays (welcome 2020) Go to Preferences > Keymap. Change or add the value to
Add Carets to Ends of Selected Lines => CMD+SHIFT+L to have it behave like Sublime Text so it looks like
Old Answer
This is as close as I could get it (before 2020):
Go to Preferences > Keymap. Search for Clone Caret Above/Below.
On a Mac, it looks like this
The keys are:
CMD+SHIFT+CTRL+ARROW_UP for Clone Caret Above
CMD+SHIFT+CTRL+ARROW_DOWN for Clone Caret Below
Click on Apply and it will work
With WebStorm 11 (at least) the multi-caret keyboard shortcut is:
Ctrl then Ctrl+Arrow Up (or click & drag with the middle mouse button/scroll wheel)
then to select the full lines:
Home then Shift+End
which you could even create as a macro with a keyboard shortcut.
I used to accidentally activate the multi-caret all the time (I scroll with Ctrl+Up/Down), so I knew how to do part of it, but it took me ages to figure out that extra Ctrl tap at the beginning.
Hold down Alt + Shift and left click on the lines you want to select. This will put multiple cursors on the editor. Now you can use the Select Line at Caret option you mentioned to select all those lines.
You can find more about multiple selections here.
This is currently not possible with a selection. However, you can still do that from the keyboard. Instead of doing selections set up a shortcut for Clone Caret Above (Alt+Shift+U for me) and Clone Caret Bellow (Alt+Shift+D for me). This allows to go up or down a line and add a caret there. So instead of selecting each line, you directly move the caret there and clone it.
I am also coming from Sublime Text and missing that feature, but this worked also pretty well.

IntelliJ Split Window Navigation

If I split the editor window (horizontal or vertical) into N tab groups, how do I switch/toggle from one tab group to another via the keyboard? If all of the tabs are in the same group you can switch from each tab easily (CTRL + right/left arrow), but when they're in separate tab groups I can't. I've searched through the key mappings and have not found one that seems to accomplish this. I know I can use the mouse, but I'm trying to find ways to avoid the mouse and stay with the keyboard.
TIA for any help on this.
Ctrl+Tab and Ctrl+Shift+Tab for Window | Goto Next Splitter and Goto Previous Splitter. However, these hotkeys may be taken by the Switcher, so you need to remap them in Settings | Keymap.
It looks like it's now mapped to Alt+Tab and Shift+Alt+Tab so no need to remap (at least for OSX 10.5+ settings).
I had the same case and this plugin solve my problem:
https://plugins.jetbrains.com/plugin/7475-tab-shifter
https://github.com/dkandalov/tab-shifter
As I write this, here is what it support:
Move tab to another editor split
Move focus between splits
Resize the split
You may refer more details on the page/github. It works pretty well in 2019.2
I can switch the splitters with CTRL+E and then ENTER.
If you have more then 2 splits, then you can navigate or quick search in the Recent Files dialog.
Switching the splitters with the Switcher doesn't work.