Sublime Forum

Text is the default

#1

I’m trying out Sublime text 3 but every time I close and then reopen it the syntax is set to text how do I get it to stay on html?

0 Likes

#2

https://packagecontrol.io/packages/Default%20File%20Type

0 Likes

#3

Thank you for the quick response, however It still doing the same thing, I have to manually set syntex to HTML but when I’m done it reverts back to text.

0 Likes

#4

Try this:

0 Likes

#5

I have, thanks anyway!

0 Likes

#6

There are a couple of things that may trip you up with this package.

The first is that it only creates new files with your preferred default syntax when you manually create a new file using the new file keyboard binding (Ctrl+N or ⌘+N depending on your OS).

That means that when you create a brand new window (manually or when you start Sublime that way), the new window has a default temporary file view in it that’s set to the Plain Text syntax, which this package does not affect. However if you press the key binding, the temporary view will be replaced by one with your desired syntax (if you press it before you type anything).

The second is that the default settings tell the package to use the syntax of the current file when creating the new file by default (use_current_file_syntax is set to true), which means that in the above case pressing the key uses the Plain Text syntax of the temporary view for the new syntax, completely subverting pressing the key in the first place.

Altering the value of that setting to false should do what you want.

0 Likes