Skip to content

Instantly share code, notes, and snippets.

@firstclown
Created March 11, 2014 19:38
Show Gist options
  • Save firstclown/9493410 to your computer and use it in GitHub Desktop.
Save firstclown/9493410 to your computer and use it in GitHub Desktop.
Keep view centered on caret (a la Scrivener) when in distraction free mode. Needs the awesome FullScreenStatus plugin.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import re
import sublime
import sublime_plugin
class KeepCentered(sublime_plugin.EventListener):
def on_modified_async(self, view):
if sublime.active_window().settings().get('fss_on_distraction_free'):
view.show_at_center(view.sel()[0].begin())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment