Skip to content

Commit

Permalink
add ZZ command
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermooo committed Jan 5, 2012
1 parent 3e76932 commit 27ed480
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Default.sublime-keymap
Expand Up @@ -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"},
Expand Down
7 changes: 7 additions & 0 deletions vintage_commands.py
Expand Up @@ -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')

0 comments on commit 27ed480

Please sign in to comment.