Answer the question
In order to leave comments, you need to log in
How to set default syntax for Sublime Text 3 new tab. Or allow Emmet snippets to be used for Plain Text syntax?
The goal is to have emmet available when creating a new tab in sublime. So, there are two ways:
1. Set html to the default syntax, which is not in "preferences" -> "settings - default".
2. Allow emmet for Plain Text syntax. In Emmett's config, I found that you can do this:
"syntaxProfiles": {
"html": "xhtml",
"css": "css_line",
"plain text": "xhtml" // * вот тут не хавает, хотя я пробовал по всякому: plain_text, plainText и тд
}
Answer the question
In order to leave comments, you need to log in
1. Creating your own pluginPreferences
→ Browse Packages...
→ in the folder, User
create a file default_syntax.py
with the following content:
import sublime, sublime_plugin
class DefaultSyntaxCommand(sublime_plugin.EventListener):
def on_new(self, view):
view.set_syntax_file('Packages/HTML/HTML.tmLanguage')
"syntax_mapping": {
"Packages/Python/Python.sublime-syntax": ["import"],
},
{
"syntax_mapping": {
"ANSIescape/ANSI.tmLanguage": ["^\\s*\\[[email protected]*\\] git l\\b"],
"Packages/PHP/PHP.sublime-syntax": ["<\\?php", "<\\?="],
"Packages/Python/Python.sublime-syntax": ["import"],
},
"working_scope": "(?x)^(text.plain | source.diff)\\b"
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question