Skip to content

Instantly share code, notes, and snippets.

@scottlaplant
Last active February 28, 2016 15:22
Show Gist options
  • Save scottlaplant/6d410cf5dcf6edb0dfa9 to your computer and use it in GitHub Desktop.
Save scottlaplant/6d410cf5dcf6edb0dfa9 to your computer and use it in GitHub Desktop.
Create default document type in Sublime Text
Make default document Sublime Text 3 creates is HTML
Go to Tools -> New Plugin
Then paste this over the file, hit save and call it "DefaultHTML.py" or whatever you like
import sublime, sublime_plugin
class EverythingIsHTML(sublime_plugin.EventListener):
def on_new(self, view):
view.set_syntax_file('Packages/Text/Plain text.tmLanguage')
Of course, you can change the language from HTML to ... whatever you prefer. You just need the relative path to the tmLanguage. You can get that by opening a file in your favorite language and then open the console (View->Show Console) and type:
view.settings().get('syntax')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment