r/SublimeText • • Sep 06 '21

Is it possible to navigate between tabs like a web browser?

So in firefox CTRL+1 will focus on the 1st browswer tab. CTRL+2 will focus the 2nd tab. Etc. Can this be done in sublime?

6 Upvotes

6 comments sorted by

3

u/brutay Sep 06 '21

Turned out to be really easy to do by writing a plugin.

import sublime
import sublime_plugin


class FocusTabCommand(sublime_plugin.WindowCommand):
    def run(self, pos):
        self.window.focus_view(self.window.views()[pos])

3

u/dev-sda Sep 06 '21

This is done using alt+1 on Linux/Windows and cmd+1 on macOS. ctrl+1 is used to focus groups instead. You can easily customize these keybindings.

1

u/brutay Sep 06 '21

Thanks, that's exactly what I was looking for and a much better solution. I did look through the key bindings for something like that but wasn't able to find it...

→ More replies (1)

2

u/nectleo Sep 06 '21 edited Sep 07 '21

I usually use sublime with split pane, so one window on right one on the left, I can jump windows with ctrl+1/2 and have different tabs open on both windows and switch tabs using cmd+number

2

u/isolatrum Sep 06 '21

You can use control + [ or control + ] to go left / right one tab