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