Sublime Forum

Sublime 3-how to default a language?

#1

I am new to programming and am currently learning Python2. I was wondering whether is it possible to default the language to Python like in notepad++? How should I do it?
I prefer the layout of sublimetext 3 but when I am creating a new program there is no text highlighting-until before i save the document in a .py format- and that is a real pain in the a**.

0 Likes

#2

There is no setting to do that directly. As you’ve noticed, by default Sublime wants to determine what kind of file something is by its name, and since it’s just a general Text editor it assumes Plain Text by default.

There are various ways to tweak the syntax of the current file (e.g. from the Command Palette, from the Menu, from the Status bar) but in order to make files have a different type by default you would need a plugin that changes the settings.

There is a package in PackageControl called Default File Type that does that very thing.

0 Likes