Skip to content

Instantly share code, notes, and snippets.

@yzhong52
Created September 6, 2021 14:01
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 yzhong52/079aa385640d17fc3a9520130a7a0b41 to your computer and use it in GitHub Desktop.
Save yzhong52/079aa385640d17fc3a9520130a7a0b41 to your computer and use it in GitHub Desktop.
Sublime Text Plugin - ExampleCommand.py
def format(input):
...
class BracketFormatterCommand(sublime_plugin.TextCommand):
def run(self, edit):
whole_region = sublime.Region(0, self.view.size())
text = self.view.substr(sublime.Region(0, self.view.size()))
formatted_text = format(text)
self.view.replace(edit, whole_region, formatted_text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment