Search code examples
sublimetext3sublimetext

Sublime Text 3 specific file type settings only has JSON file settings. How to create new?


I'm trying to create a syntax specific settings for file types in ST3. As per the documentation I am supposed to find what I need in

Sublime Text>Preferences>Settings - More>Syntax Specific - User

However, when I click that I only get JSON.sublime-settings file. What if I want some other settings file?


Solution

  • The settings file that opens when you select Prefereces > Settings - Syntax Specific is sensitive to the type of file that you're currently editing. So, if you happen to be in a JSON file when you invoke the menu command, you get the file for settings specific to JSON.

    In order to get at the setting specific to a different syntax, open a file of that type first, or create an empty buffer and set the syntax to the desired language via View > Syntax from the menu, the command palette, or the menu that pops up when you click the file type in the right side of the status bar (where it will say Plain Text).

    The file that you actually want to save is SyntaxName.sublime-settings in your User package, e.g. Python.sublime-settings for Python, etc. However to forestall any problems with the filename (like incorrect case or spelling) it's generally better to do it as above instead, particularly since the name of the syntax can sometimes be non-obvious.