for instance I have a .zsh file that I would like to always open in sublime as a "Shell Script (bash)" file type. Currently it defaults back to a text file format even when I change and reopen it.
Asked
Active
Viewed 1.3k times
1 Answers
50
Look in the bottom right of the window.
Click the file type name. Let's assume it is 'Shell Script (Bash)'.
Notice that the first option is 'Open all with current extension as...'
Follow the obvious steps from there and you should be all set.

jwpfox
- 5,124
- 11
- 45
- 42
-
1Nothing is obvious until it is :) – jwpfox Jan 11 '16 at 13:00
-
@jwpfox, do you know this is possible using file definitions (not file extensions)? I'm looking if Sublime Text can auto syntax files that have no file extensions (legacy system I'm maintaining) but are defined in the first code line (like #!/bin/ksh ). KornShell (ksh) isn't available in ST3, but I would want to automatically syntax it as bash script. If I use your trick on files with no extensions, I mess up other script files in my system that have no file extensions, (few Perl scripts that auto syntax without file extension). Thought I asked here first before submitting a new question. – Gunnar Aug 14 '17 at 11:35
-
1@Gunnar My understanding is that what you want is not possible but worth asking a real question to see if the real experts can prove me wrong :) – jwpfox Aug 14 '17 at 12:18
-
@jwpfox Will do, thanks for the quick reply :) I did more online digging and it looks like I can only do it by creating a new ST3 package and defining the it myself. Looks easy enough, though I haven't tried it yet: http://docs.sublimetext.info/en/latest/extensibility/syntaxdefs.html#creating-a-new-syntax-definition – Gunnar Aug 14 '17 at 13:16