Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add ZZ command

  • Loading branch information...
commit 27ed4807f65b5190bccf52b4fd3c75c7ca643646 1 parent 3e76932
@guillermooo guillermooo authored
Showing with 9 additions and 0 deletions.
  1. +2 −0  Default.sublime-keymap
  2. +7 −0 vintage_commands.py
View
2  Default.sublime-keymap
@@ -62,6 +62,8 @@
{ "keys" : ["z", "z"], "command" : "center_on_cursor", "context": [{"key": "setting.command_mode"}] },
+ { "keys": ["Z", "Z"], "command" : "vi_save_and_exit", "context": [{"key": "setting.command_mode"}] },
+
{ "keys": ["i"], "command": "enter_insert_mode", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["I"], "command": "enter_insert_mode", "args":
{"insert_command": "vi_move_to_first_non_white_space_character"},
View
7 vintage_commands.py
@@ -39,3 +39,10 @@ def run(self, edit):
file_name)
if os.path.exists(file_name):
self.view.window().open_file(file_name)
+
+class ViSaveAndExit(sublime_plugin.WindowCommand):
+ def run(self):
+ self.window.run_command('save')
+ self.window.run_command('close')
+ if len(self.window.views()) == 0:
+ self.window.run_command('close')
Please sign in to comment.
Something went wrong with that request. Please try again.