Skip to content

Instantly share code, notes, and snippets.

@tpitale
Created August 27, 2014 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tpitale/29aa13c4cba45dd3392e to your computer and use it in GitHub Desktop.
Save tpitale/29aa13c4cba45dd3392e to your computer and use it in GitHub Desktop.
Center Sublime Text 2 on current line when changing
import sublime_plugin
class AlwaysCenterCommand(sublime_plugin.EventListener):
def on_modified(self, view):
sel = view.sel()
region = sel[0] if len(sel) == 1 else None
if region != None:
view.show_at_center(region)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment