Sublime Text 2 and .less Syntax Highlighting

So you've hopped onto the Sublime Text 2 bandwagon and ready to roll with {less}. Now you simply want to enable syntax highlighting while working on .less files...right? Well, it's actually quite simple!

First, open a .less file in Sublime Text 2. Then View > Syntax > Open all with current extension as... > CSS


After originally publishing this, of course I stumble across a github project called Less-sublime. Using the Package Control plugin, it's an absolute breeze to setup. Even if you don't, simply follow the installation directions on the github project.

So there you go...two methods for getting {less} syntax highlighting for you! Either way works great, but obviously the github project offers a bit more {less}-specific syntax support.

Hope that helps...cheers!


So how are you liking Sublime Text2?
# Posted By Matt Levine | 2/1/12 10:14 PM

I'm finding myself using it more than I thought I would...I still use Dw for some things though. However, I rarely launch CF Builder anymore. Glad you put me onto this!

# Posted By Steve Withington | 2/2/12 8:07 AM
I've been using it this week and like it. Y'all need to install the Zen Coding package.
# Posted By TonyAdams | 2/2/12 8:25 AM

Thanks for sharing...that looks pretty sweet!
# Posted By Steve Withington | 2/2/12 8:50 AM
If you haven't already check out also available via Package Control.
# Posted By atomi | 2/4/12 4:03 AM

already installed my man! in fact, you should be able to see it as an option in the screenshot just above CSS in the blog post :)

great work btw...cheers!
# Posted By Steve Withington | 2/4/12 9:43 AM
Perfect! Just what I was looking for. Installed in a snap with Package Control!

Many Thanks,
# Posted By Nick Tomlin | 4/17/12 9:04 AM
Looks good ...

Since I moved to (G|Mac)Vim ... I ain't looked back :-)
# Posted By Edward Beckett | 7/2/12 10:18 PM
Great but I wonder how I can edit my theme so that lines with // turn grey like normal css comments?
# Posted By artdog | 7/11/12 8:47 AM
@artdog: You can also try this syntax highlighter specifically created for .LESS files:
# Posted By joan | 10/15/12 12:19 PM
If anyone is wondering, the installation through Package Control is not working but no problem, you just need to download the latest version, unzip on you "Packages" directory and rename it to "LESS", restart sublime and you're ready to rock.
# Posted By JorgeArtware | 7/14/13 8:19 PM
Its working fine. Thanks a lot
# Posted By flashaddicts | 5/27/14 10:28 AM

© 2024, Stephen J. Withington, Jr.  |  Hosted by

Creative Commons License   |   This work is licensed under a Creative Commons Attribution 3.0 Unported License.