Skip to content

Instantly share code, notes, and snippets.

@Rich-Harris
Forked from wuub/gtfo.py
Last active August 29, 2015 13:56
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 Rich-Harris/9077752 to your computer and use it in GitHub Desktop.
Save Rich-Harris/9077752 to your computer and use it in GitHub Desktop.
import sublime, sublime_plugin
BUILD_COLOR_SCHEME = "Packages/Color Scheme - Default/Dawn.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("You're editing a file in the build folder. That's probably not what you want.")
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