Sublime text 3 change focus to next split view pane

Posted on

QUESTION :

How can I easily switch the active pane to the next pane in my SplitView ?

Suppose I am working with a vertical split view of 2 screens, and I need to rapidly change the focus from view n°1 to view n°2 to copy paste various elements

Currently I found no other means than to click the other pane to change the focus. Is it possible to have a keyboard shortcut that would cycle through split views ? (Sometimes I have 3 vertical splits and would like to have something similar to the Alt-Tab shortcut but for the split views only.

ANSWER :

Is it possible to have a keyboard shortcut that would cycle through split views?

I don’t think you can cycle, but you can go direct to a view:

Ctrl+1..4 – Jump to group where num is 1..4

Source 75 Shortcuts for Sublime Text

I use ++{/} to move between tabs.
But it also works across panes.

So if you only have one tab per pane, or you want to switch between the rightmost tab in pane 1 and the leftmost tab in pane 2, this does exactly what you want.

The snippet below will add keyboard shortcuts to navigate forward (⌥ALT+TAB) and backward (⌥ALT+SHIFT+TAB) between panes in multi-pane views. Add this to your User keybindings:

{ "keys": ["alt+tab"], "command": "focus_neighboring_group", "args": {"forward": true}},
{ "keys": ["alt+shift+tab"], "command": "focus_neighboring_group", "args": {"forward": false}}

Works for me on ST4. Have not tested with earlier versions.

Sublime Text 4 (Build 4126) on Linux has the following options

Change focus to next tab: CtrlJ then CtrlPage Down

Change focus to previous tab: CtrlJ then CtrlPage Up

Change focus to a specific tab: Alt1 or Alt2 or Alt3 etc.

Notes

  • If you use the keyboard shortcut to change focus past the first or last tab, it closes split view and keeps only the current view visible. For example, if you have 3 tabs visible in split view and you are focused on the first tab and press CtrlJ then CtrlPage Up, split view will close and you will only see the content of the first tab. Likewise if you are focused on the third tab and press CtrlJ then CtrlPage Down, then split view will close and you will only see the content of the third tab.
  • The number you press with Alt represents the tabs currently open in the split, not the number out of all the tabs. So if you have 3 tabs open but only the first and third tabs are visible in split view, then you would press Alt2 to change focus to the third tab.

Here’s where it is in the menu

enter image description here

Leave a Reply

Your email address will not be published. Required fields are marked *