Sublime Text 2 Default file type for new file

I looked around and the questions and answers did not seem to match what I was looking for. At any time, I open a new default file for the plan text file. I mainly work with HTML files, so I was wondering if there is a parameter that will be changed so that when opening a new file it would default to HTML? Hope this is possible.

Rob

+8
source share
3 answers

Create a new plugin Tools > Developer > New Plugin...

Insert this into:

 import sublime, sublime_plugin class EverythingIsPowerShell(sublime_plugin.EventListener): def on_new(self, view): view.set_syntax_file('Packages/PowerShell/Support/PowershellSyntax.tmLanguage') 

Save and name it NewTabSyntax.py . New tabs will now be by default in Powershell.

You can change the syntax to whatever you prefer. To find the "path" of a particular syntax, simply open the file for that syntax, open the console (" View > Show Console ) and enter:

 view.settings().get('syntax') 
+7
source

pls install sublime-DefaultFileType package https://github.com/spadgos/sublime-DefaultFileType

which automatically sets the syntax for new files.

+1
source

This is possible with the ApplySyntax plugin. After installing it (for example, through PackageControl ), you can set the ApplySyntax user parameters as follows:

 "new_file_syntax": "HTML", 

Now, if you open a new file, your default syntax will be HTML. Of course, you can install every syntax you set.

+1
source

Source: https://habr.com/ru/post/922143/


All Articles