Home Download Buy Blog Forum Support

Apache Conf file syntax definition

Apache Conf file syntax definition

Postby GreyWyvern on Fri Nov 13, 2009 8:05 pm

Here's another syntax highlighting package I'm working on, this one for Apache Conf files, which will also work for .htaccess, .htpasswd, and .htgroups files.

ApacheConf.tmLanguage_0.1.zip
Apache Conf file syntax highlight package
(3.64 KiB) Downloaded 6897 times


Image

There's still a lot of work to do on this one to cover everything. I'm testing the waters to see if there is much interest :)
GreyWyvern
 
Posts: 106
Joined: Fri Oct 23, 2009 7:08 pm
Location: Canadia

Re: Apache Conf file syntax definition

Postby kevinpeno on Tue Nov 17, 2009 6:09 pm

Thanks for this. While I don't normally care that I've never had highlighting for apache files, this is definetly nice. For anyone intrested, rename the download to something like "apache-conf-filetype.sublime-package" and let it install. after restart the highlighting will be available.

Would be nice if this auto-associated itself to .htaccess and other files that are definetly apache config.
kevinpeno
 
Posts: 1
Joined: Mon Nov 16, 2009 8:33 pm

Re: Apache Conf file syntax definition

Postby ERnest on Mon Nov 23, 2009 8:53 pm

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..?
ERnest
 
Posts: 1
Joined: Mon Nov 23, 2009 8:50 pm

Re: Apache Conf file syntax definition

Postby jbjornson on Wed Dec 09, 2009 2:26 pm

ERnest wrote: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..?


I found these sites helpful:

I ended up browsing through some existing tmLanguage files and patching something together from them.
jbjornson
 
Posts: 353
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Apache Conf file syntax definition

Postby radiosilence on Wed Mar 24, 2010 11:45 am

Micropatch so it supports comments that have spacing in front of them.

http://gist.github.com/342212
radiosilence
 
Posts: 5
Joined: Sun Sep 20, 2009 6:18 pm

How to fix the file association?

Postby _ michael on Sun Jan 30, 2011 6:18 pm

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
_ michael
 
Posts: 4
Joined: Sun Jan 30, 2011 6:08 pm

Re: How to fix the file association?

Postby gpfsmurf on Mon Jan 31, 2011 8:15 pm

_ michael wrote: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?

You can customize this plugin: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa

Just add something like:
Code: Select all
if name in [".htaccess", ".htpasswd"]:
   setSyntax(view, "ApacheConf")
gpfsmurf
 
Posts: 211
Joined: Mon Jun 23, 2008 6:31 pm

Re: Apache Conf file syntax definition

Postby _ michael on Tue Feb 01, 2011 1:57 pm

Works. Excellent! Thanks!
_ michael
 
Posts: 4
Joined: Sun Jan 30, 2011 6:08 pm

Re: Apache Conf file syntax definition

Postby jps on Tue Feb 01, 2011 7:29 pm

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.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: Apache Conf file syntax definition

Postby GreyWyvern on Fri Feb 04, 2011 3:01 pm

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. :)
Attachments
ApacheConf_0.2.zip
(3.77 KiB) Downloaded 18663 times
GreyWyvern
 
Posts: 106
Joined: Fri Oct 23, 2009 7:08 pm
Location: Canadia

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 7 guests