0

Been struggling with this for a little while.

Sublime Text 2. Every time I load a shell script it displays as plain text and I have to re-set the display to Shell Script (Bash).

Was having the same trouble with Rails file.css.scss but found ST supports sass files. I hoped for the same for Shell Scripts but haven't figured it out.

-Thanks!

EDIT

Upgrading to Sublime Text 3 seemed to have solved the problem, and the other answer suggested here seems like it would have solved the problem if the upgrade hadn't. I removed the she-bang from the script and it was loaded as plain text, replacing it loaded as shell script. Apparently ST3 added recognition of the she-bang.

Nate Anderson
  • 777
  • 2
  • 7
  • 26
  • If you create a new document, (File > New File), it by default opens as a Plain Text file. It you then copy and paste this shebang `#!/bin/bash` into the new file, does it automatically change to Shell Script (Bash)? – user3439894 Apr 17 '16 at 01:53
  • @user3439894 adding a shebang won't change the syntax of an already-opened file. However, as the OP notes in the updated question, ST3 now supports reading some of the file's contents as well as its extension in order to determine which syntax to use *when the file is first opened*. – MattDMo Apr 18 '16 at 14:51
  • @MattDMo, You said, "_adding a shebang won't change the syntax of an already-opened file._" and I already knew that and why I didn't ask nor care about an already opened file and why I explicitly and specifically said "_If you create a new document, (File > New File), it by default opens as a Plain Text file. It you then copy and paste this shebang `#!/bin/bash` into the new file, does it automatically change to Shell Script (Bash)?_" as the answer to that question would have provided me diagnostic feedback. Anyway, the issue is mute as per the edit to the OP made after I posted my comment. – user3439894 Apr 18 '16 at 15:12

0 Answers0