Sublime Forum

How do I tell sublime to treat '.conf' files as if they were bash scripts?

#1

I think the subject says it all. I create files with the .conf extension that are actually bash scripts. Sublime does not highlight them correctly. Can it? I’m aware I can do this by going to View >> Syntax >> Shell Script but I’m looking for a way for Sublime to always load these as bash scripts. Thanks

0 Likes

#2

You can accomplish this by using the submenu View > Syntax > Open all with current extension as….

2 Likes

#3

That worked, thanks! Just out of curiosity, I looked at Preferences >> Settings – More >> Syntax Specific – User and it now contains this:

{
“extensions”:
[
“conf”
]
}

I’m wondering how it knows “conf” is “bash”…

0 Likes

#4

The name of that settings file will be Shell-Unix-Generic.sublime-settings, where Shell-Unix-Generic.sublime-syntax is the name of the syntax file for Shell Script (Bash).

0 Likes

#5

Thanks, interesting

0 Likes