Sublime Forum

[Question] Switch tabs with Ctrl+NUM

#1

How can I make Ctr+1 open the first (as in the display order) tab, Ctr+2 open the second displayed tab, … etc? i.e., like Chrome tab switching.

Thanks in advance!

0 Likes

#2

For reference, this is set up out of the box to work as Alt+# instead of Ctrl+# so if you wanted to retrain your brain, you only have to remember to press a different key.

However, that’s not very Sublime, so to get it working the way you want, you can add the following to your custom key bindings (Preferences > Key Bindings - User).

{ "keys": ["ctrl+1"], "command": "select_by_index", "args": { "index": 0 } },
{ "keys": ["ctrl+2"], "command": "select_by_index", "args": { "index": 1 } },
{ "keys": ["ctrl+3"], "command": "select_by_index", "args": { "index": 2 } },
{ "keys": ["ctrl+4"], "command": "select_by_index", "args": { "index": 3 } },
{ "keys": ["ctrl+5"], "command": "select_by_index", "args": { "index": 4 } },
{ "keys": ["ctrl+6"], "command": "select_by_index", "args": { "index": 5 } },
{ "keys": ["ctrl+7"], "command": "select_by_index", "args": { "index": 6 } },
{ "keys": ["ctrl+8"], "command": "select_by_index", "args": { "index": 7 } },
{ "keys": ["ctrl+9"], "command": "select_by_index", "args": { "index": 8 } },
{ "keys": ["ctrl+0"], "command": "select_by_index", "args": { "index": 9 } },
3 Likes

#3

Exactly what I wanted. Thanks!

0 Likes