Skip to content

Instantly share code, notes, and snippets.

@OdatNurd
Last active March 7, 2018 23:23
Show Gist options
  • Save OdatNurd/99acc1dbbeec83bbdb46f876990cd764 to your computer and use it in GitHub Desktop.
Save OdatNurd/99acc1dbbeec83bbdb46f876990cd764 to your computer and use it in GitHub Desktop.
Fold all newly loaded files and all files loaded from the session file at Sublime startup
import sublime
import sublime_plugin
def fold(view):
view.run_command("fold_by_level", {"level": 2})
def plugin_loaded():
for window in sublime.windows():
for view in window.views():
fold(view)
class FoldingEventListener(sublime_plugin.EventListener):
def on_load_async(self, view):
fold(view)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment