Sublime Forum

Command to focus on the rightmost tab


Hi everyone,

I using ST3 in Windows 10. The key binding alt + 1 focuses on first open tab, alt + 2 on the second tab, and so on. Is there a command to focus on the rightmost tab? This would be similar to Ctrl + 9 in Google Chrome. I look forward to hearing from you.

1 Like


It’s trivial to create a command via the plugin API

import sublime
import sublime_plugin

class FocusLastViewCommand(sublime_plugin.WindowCommand):

    def run(self):
        views = self.window.views_in_group(self.window.active_group())
	"keys": ["ctrl+9"],
	"command": "focus_last_view",

It looks like the built in select_by_index (the command behind the alt + n) doesn’t take negative args. Something like the following doesn’t work.

	"keys": ["ctrl+9"],
	"command": "select_by_index",
	"args": {
		"index": -1

So maybe the plugin approach is the only way unless I am missing something (or there is some other way through builtin commands).


ST4: Set cmd+0 to last file in tab (similar behavior as Chrome)

Works like a charm! Thank you so much for the quick reply!



+1 if select_by_index can support -1