When I launch Sublime Text, it opens up to a blank document with the language set to “Plain Text”.
Is there any way that I can get Sublime Text to automatically default this blank document to “Javascript”?
When I launch Sublime Text, it opens up to a blank document with the language set to “Plain Text”.
Is there any way that I can get Sublime Text to automatically default this blank document to “Javascript”?
You can override the ctrl + n keybinding (which always opens a new tab/new file with Plain Text
syntax) to something that always has the JavaScript
syntax set to it.
{
"keys": ["ctrl+n"],
"command": "new_file",
"args": {
"syntax": "Packages/JavaScript/JavaScript.sublime-syntax"
},
},
Place this in your User
keybindings. Now whenever you open a new file with ctrl + n, it should automatically have the JavaScript
syntax applied to it.
Thank you so much!
I’m actually not a coder (yet), so I’m brand new to all of this! But I figured it out, thanks to your help! It works!
Do you have a method to set default language for blank documents opened via double-clicking on the tab area?
ApplySyntax has an option that may work.
https://facelessuser.github.io/ApplySyntax/usage/#new-file-syntax
Oh yes, this worked perfectly! It even changes the default syntax for Ctrl + N tabs! Thank you so much!
"new_file_syntax": "MarkdownEditing/Markdown"