K
K
kirillinyakin2019-08-20 10:36:17
Python
kirillinyakin, 2019-08-20 10:36:17

How can one change the default syntax of Sublime Text 3?

Every time I create a new file, Sublime Text makes Plaint Text the default syntax, how can I change that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
y0u, 2019-08-20
@kirillinyakin

Create a python file in the Packages directory, where instead of {LANG} insert your syntax:

import sublime, sublime_plugin

class DefaultSyntax(sublime_plugin.EventListener):
    def on_new(self, view):
        view.set_syntax_file('Packages/{LANG}/{LANG}.tmLanguage')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question