Sublime Forum

Any way to change the default syntax from plaintext?


Hello, I love sublimetext but I only use it for one thing: SourcePawn scripting. I almost exclusively just start writing code, or paste code in to look at before saving anything and I’m growing tired of having to manually go through a couple dropdowns to scroll and select my syntax. Is there any way that I can simply change the default from PlainText to SourcePawn? I would love for it to just always be in SourcePawn mode. I am using Sublime Text 3.



Install Package Control if you haven’t already, then install the Default File Type plugin. It allows you to set the syntax for any new file created with Ctrl-N/Cmd-N.



You can probably use the logic of that plugin with an “on_new” listener so it’s not just ctrl+n/cmd+n.