Hi guys
This is very useful, thank a lot!
I want to create syntax highlighting for another languge, but I can’t fount any manual for this… Can you give some advice aboout this…?
Apache Conf file syntax definition
[quote=“ERnest”]Hi guys
This is very useful, thank a lot!
I want to create syntax highlighting for another languge, but I can’t fount any manual for this… Can you give some advice aboout this…?[/quote]
I found these sites helpful:
Existing language syntaxes: svn.textmate.org/trunk/Bundles/
Documentation on creating syntax highlighting: manual.macromates.com/en/language_grammars
I ended up browsing through some existing tmLanguage files and patching something together from them.
Thanks for that! I’ve just installed it, very helpful indeed.
I’ve seen that you have listed .htaccess, .htpasswd etc as associated extensions, but it doesn’t seem to be working. It’s working for the .conf extension, though.
My guess is that the file association mechanism gets confused if the file name consists of nothing but the extension, as in “.htaccess”. Does anyone know a workaround?
Cheers,
Michael
You can customize this plugin: pastie.org/private/kz8gtts0cjcvkec0d4quqa
Just add something like:
if name in ".htaccess", ".htpasswd"]:
setSyntax(view, "ApacheConf")
When Sublime Text encounters a file name like “.htaccess”, it concludes that the file has no extension, and that it’s name is “.htaccess”.
The fileTypes entry in tmLanguage files, at least as interpreted by Sublime Text, can contain either extensions (without the dot) or full filenames (e.g., ‘Makefile’). To have it pick up .htaccess files, you should just need to ensure that “.htaccess” is included in the list with the leading dot.
Excellent, I thought it would be something simple like that. Here is an updated file that includes the dots and also the fix from radiosilence for comments with spaces in front of them.
ApacheConf_0.2.zip (3.77 KB)
There is no difference between Sublime 1 and 2 compatibility wise when it comes to syntax definitions (.tmLanguage files). Should work the same in Sublime 2 as it did in Sublime 1.
This is very useful - well done. I’ll second the github call - it would be great to have this in packagemanager.
Thanks
/Eoin/
BAM
https://github.com/colinta/ApacheConf.tmLanguage
Or install via Package Control (ApacheConf.tmLanguage)
Full credit goes to original TextMate bundle, GreyWyvern, and radiosilence.
I just caught a mistake! Apparently, this is a GreyWyvern original. I’ll update credit/authors accordingly.
Hey guys,
Thanks @colinta for githubbing that. However I get
Package Control: Error downloading package. HTTP error 404 downloading https://nodeload.github.com/colinta/ApacheConf.tmLanguage/zipball/v1.0.0.
when I try to install via PackageManager. There doesn’t seem to be a 1.0.0 tag for the project on github so I’m guessing the repositories.json needs updating. Thanks for your time.
cheers
/Eoin/
Thanks! Git tag mishap, accidentally tagged it as v1.0.1
Should install just fine now.
I suggest you upload this to GitHub so it doesn’t get lost so easily and other people can contribute to it.
…brilliant. Many thanks to the contributors (GreyWyvern, radiosilence, colinta) thumbsup