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**.
Sublime 3-how to default a language?
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.
This one does not work if you double-click the empty area in the tab bar to open a new note, or if you start a new note in other ways.
A better package is ApplySyntax:
- Once installed, CTRL+SHIFT+P and type
ApplySyntax: Settings - In the right pane, change the
new_file_syntaxsetting- From:
"new_file_syntax": false, - To:
"new_file_syntax": "Markdown/Markdown",(for example) - Then save
- From:
- Go have a cupcake, you’ve earned it
Related: Default language for new blank documents
Related: Markdown as default syntax
Related: https://stackoverflow.com/questions/40222760