The LESS Textmate Bundle

Monday, Oct 10, 2011

I’ve been using LESS on a project the past month or so as a better way to organize my stylesheets (I’ve since switch to Sass, for reasons I don’t need to get into here, but LESS is good and accomplishes the same purpose). There’s a LESS package for node.js that installs a command line tool you can use to convert the files, and also a LESS Mac App that will watch a directory and convert any .less files in there to CSS any time they get saved. Very handy.

I also recently started using TextMate for a lot of my development work, and I needed it to do the syntax highlighting for LESS, so I found this LESS TextMate Bundle on Github that does the highlighting, but also has a nice built-in command that automatically converts the .less file you’re working on every time you save it. Unfortunately the bundle is really out of date (I think the last commit was from mid-2010 or so), so that save command didn’t work anymore. Since the command is just a script that gets run when you hit Command-S, and I thought it would come in handy, I decided to just open up the bundle and fix it myself.

You can download and use my modified TextMate LESS Bundle on Github. It requires you to have the LESS node package installed, and it just converts the .less file into an identically named .css file in the same folder. I like it means I don’t need to have running, and more free memory is always a good thing. Hopefully, you’ll find it useful.