The Artima Developer Community
Sponsored Link

Java Buzz Forum
Vim syntax highlighting for LESS

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Tim Vernum

Posts: 58
Nickname: tpv
Registered: Dec, 2002

Tim Vernum is passionate about designing secure systems
Vim syntax highlighting for LESS Posted: Feb 3, 2012 7:30 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Tim Vernum.
Original Post: Vim syntax highlighting for LESS
Feed Title: A word used to describe something
Feed URL: http://blog.adjective.org/feed/category/Development/rss2
Feed Description: Tim's random musings on software development, java, jetty and other such frivolities.
Latest Java Buzz Posts
Latest Java Buzz Posts by Tim Vernum
Latest Posts From A word used to describe something

Advertisement

There's a pretty good vim syntax file for the LESS dynamic stylesheet language but it has a minor issue with font properties.

Groenewge's syntax file on github seems to be the best version. It makes use of any existing CSS syntax files you have including the one that ships with Vim.

However, because the LESS syntax is more rich than pure CSS, this syntax file shows up an ambiguity in the default CSS syntax file.

Vim's css.vim (as at rev d3cf98aa1619) has font as a cssTagName and font-size / font-family / etc as cssFontProp. When you have a pure css file, these match fine. But when you load the less syntax. they become ambiguous (because less allows things in different places)

So, you find that BODY { font-size: 12pt; } will match "font" as a tag (and "-size" as text), rather than "font-size" as a property.

The fix is to make a small modification to css.vim to only match "font" as a whole-word.

I've created an issue on the google code site, and included a patch there. So, if you're using LESS + VIM, and want syntax highlighting, then it's probably worth installing that patch.

I also found that if you have hail2u's CCS3 syntax installed, then LESS parametric mixins don't highlight correctly. This is due to an overzealous media type rule in css3-mediaqueries.vim. I put in a quick fix by commenting out the first rule in that file (I don't make much use of media types anyway)

Read: Vim syntax highlighting for LESS

Topic: Introduction to OSGi - Modular Java Previous Topic   Next Topic Topic: How to reverse String in Java using Iteration and Recursion

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use