Sublime Text 2: How to set up sequential syntax highlighting for Guardfile?

While itโ€™s easy enough to set the language for this (open) file in Sublime Text, I wonder if there is a way that I can tell the editor in advance that everything called the โ€œGuardfileโ€ should be highlighted as Ruby code. Does anyone know how to do this?

+6
source share
2 answers

The plugins recommended in Brian's comments do a great job:

Update:

I could not get SyntaxFromFileName to match any of my regular expressions for some reason. DetectSyntax, on the other hand, comes with syntax highlighting for the Guardfile built into .

Update2:

DetectSyntax has been renamed ApplySyntax

+9
source

Putting the next file at the top also works

#!/usr/bin/env ruby 
+7
source

Source: https://habr.com/ru/post/922186/


All Articles