Skip to content

Instantly share code, notes, and snippets.

@renechz
Created May 4, 2013 02:06
Show Gist options
  • Save renechz/5515753 to your computer and use it in GitHub Desktop.
Save renechz/5515753 to your computer and use it in GitHub Desktop.
Enter Command Mode on save in Sublime Text.
# Vintage mode should be active first.
# Remove Vintage package from the ignored_packages setting in your User preferences.
# "ignored_packages": [""]
#
# Then you just have to create a fairly simple plugin.
# Go to Tools > New Plugin.
# Save it under Packages/User/enter_command_mode_on_save.py and you're ready to go!
import sublime, sublime_plugin
class EnterCommandModeOnSave(sublime_plugin.EventListener):
def on_pre_save(self, view):
# Activate it on your User preferences
if view.settings().get("enter_command_mode_on_save") == True:
view.run_command("exit_insert_mode")
view.run_command("exit_visual_mode")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment