Sublime Forum

Shell Syntax Highlighting using ApplySyntax

#1

I’m trying to implement the solution I found here: Stack Overflow: How to change the default syntax for new files in sublime text 3.

What I am unable to do is apply the specific syntax I need to use. I need the Bash Shell syntax highlighting, which sublime refers to as Shell-Unix-Generic. However when I adjust this setting outlined in the link above to “Shell-Unix-Generic” it doesn’t work. I’ve also tried “Shell-Unix-Generic/Shell-Unix-Generic”

Any ideas? The goal is to have every new file open with Shell syntax highlighting, instead of the default plain text. It appears this plugin allows this to happen, I just need to find the right ‘name’ for the syntax.

Thanks!

0 Likes

#2

the ApplySyntax documentation looks shockingly poor in this regard, until you realize you have to look at this page:
http://facelessuser.github.io/ApplySyntax/usage/#syntax

2 Likes

#3

Agree on that front! Thanks for the reply! I appreciate your clarification of the file path!

0 Likes

#4

It could be ShellScript/Shell-Unix-Generic, a partial path of the syntax file.

You may also interest in ShellScriptImproved if you are writing Bash. In that case, use ShellScriptImproved/Shell-Unix-Generic.

0 Likes

#5

And remember, help on documentation is always appreciated :wink:.

3 Likes

#6

I’ll leave it to someone that actually uses the plugin :wink:

but my suggestion would be to not separate the User Guide from the About ApplySyntax topic, because the About page is the first one that loads and it doesn’t contain any useful information at all about how to use the plugin - which is a shock for people used to just a single readme markdown file on most packages, which therefore has to contain all information in one place. Or at the least, include the first paragraph of the Overview from the User Guide in the About ApplySyntax page, with a link to the guide for more details and further reading. :slightly_smiling:

0 Likes

#7

I’ll be honest, I leave a big bold header on all my repos that say “Documentation” and then provide a link to the documentation right under it. I don’t want to update my docs and readme every time I change something.

My personal opinion is that people who are actually trying to read the docs to figure out how the plugin works will see the bold header and check out the documentation. Those who aren’t, I could have all the documentation in the readme, and they would still create an issue asking how to do something covered in the docs (I say this from experience).

I keep the readme small and brief so that it should be easy to quickly skim and see the big bold documentation header.

2 Likes