- Code: Select all
{ "keys": ["alt+z"], "command": "setting", "args": {"command_mode": true} }
{ "keys": ["alt+z"], "command": "setting", "args": {"command_mode": true} } { "keys": ["alt+z"], "command": "reindent", "context":
[
{ "key": "setting.command_mode", "operator": "equal", "operand": true }
]
}import sublime, sublime_plugin
class ToggleCommandModeCommand(sublime_plugin.TextCommand):
def run(self, edit):
status = bool(self.view.settings().get('command_mode'))
self.view.settings().set('command_mode', not status)[
{
"keys": ["j", "j"],
"command": "toggle_command_mode"
}
]{ "keys": ["d"], "command": "left_delete", "context":[{ "key": "setting.command_mode", "operator": "equal", "operand": true }] },
{ "keys": ["d", "d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"}, "context":[{ "key": "setting.command_mode", "operator": "equal", "operand": true }] }
Users browsing this forum: Google [Bot], Mathias and 19 guests