Skip to content

Instantly share code, notes, and snippets.

@atomkirk
Created January 1, 2014 21:46
Show Gist options
  • Save atomkirk/8211811 to your computer and use it in GitHub Desktop.
Save atomkirk/8211811 to your computer and use it in GitHub Desktop.
Exit Autocomplete and enter command mode sublime text 3

In sublime 3, the new command for exiting_insert_mode (for Vintageous used in Sublime Text 3 vs Vintage used in 2) is vi_enter_normal_mode

Create a plugin:

	import sublime, sublime_plugin
	
	class ExitAutoCompleteAndInsertModeCommand(sublime_plugin.TextCommand):
	  def run(self, edit):
	    self.view.run_command("hide_auto_complete")
	    self.view.run_command("vi_enter_normal_mode")

Then add this key binding:

	{ "keys": ["escape"], "command": "exit_auto_complete_and_insert_mode", "context":
    [
      { "key": "auto_complete_visible", "operator": "equal", "operand": true }
    ]
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment