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())
self.window.focus_view(views[-1])
{
"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).