Skip to content

Instantly share code, notes, and snippets.

@wuub
Last active August 29, 2015 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wuub/9077495 to your computer and use it in GitHub Desktop.
Save wuub/9077495 to your computer and use it in GitHub Desktop.
Drop into ~/.config/sublime-text-3/Packages/User + modify in_build_dir(view) acoordingly
import sublime, sublime_plugin
BUILD_COLOR_SCHEME = "Packages/Color Scheme - Default/Twilight.tmTheme"
def in_build_dir(view):
if not view or not view.file_name():
return False
return "/build/" in view.file_name()
class GTFO(sublime_plugin.EventListener):
def on_modified(self, view=None):
if in_build_dir(view):
sublime.error_message("GTFO")
def on_activated(self, view=None):
if in_build_dir(view):
view.settings().set("color_scheme", BUILD_COLOR_SCHEME)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment