Skip to content

Instantly share code, notes, and snippets.

@djekl
Created April 5, 2013 14:56
Show Gist options
  • Select an option

  • Save djekl/5319930 to your computer and use it in GitHub Desktop.

Select an option

Save djekl/5319930 to your computer and use it in GitHub Desktop.
import sublime, sublime_plugin
# class ExampleCommand(sublime_plugin.TextCommand):
# def run(self, edit):
# self.view.insert(edit, 0, "Hello, World!")
class ConvertTabsToSpaces(sublime_plugin.EventListener):
def on_pre_save(self, view):
edit = view.begin_edit()
view.run_command('expand_tabs', {"set_translate_tabs": True})
view.end_edit(edit)
#sublime.message_dialog("Converted endings.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment