I’m writing a plugin for Sublime Text which among other things moves the cursor to the beginning of the document.
Vintage mode has a keybinding for this sort of thing:
{ "keys": ["g", "g"], "command": "set_motion", "args": {
"motion": "vi_goto_line",
"motion_args": {"repeat": 1, "explicit_repeat": true, "extend": true,
"ending": "bof" },
"linewise": true },
"context": [{"key": "setting.command_mode"}]
}
How can I achieve the same effect or call the same command from a plugin?
In the default plugins folder there is a plugin called goto_line.py that does pretty much exactly this.