How do I set sublime text to auto detect a file type after setting it once?
11,708
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.
Related videos on Youtube
Comments
-
remainstheday over 1 year
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.
-
jwpfox over 8 yearsNothing is obvious until it is :)
-
Gunnar over 6 years@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.
-
jwpfox over 6 years@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 :)
-
Gunnar over 6 years@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: docs.sublimetext.info/en/latest/extensibility/…