Thursday, August 20, 2009

Vim syntax highlighting for lesscss

Here's a quick HOWTO for enabling vim syntax highlighting for .less (lesscss) files:
  1. Create the directory ~/.vim/syntax/ if it does not exist yet.
  2. Download the vim syntax file less.vim into that directory, e.g. with the command:
    wget http://leafo.net/lessphp/vim/less.vim
  3. Make sure the following statements are in your ~/.vimrc:
    syntax on
    au BufNewFile,BufRead *.less set filetype=less
That's all.

Update (Sept. 25, 2009): Here's a screenshot:

2 comments:

  1. Great post! Exactly what I was looking for

    ReplyDelete
  2. Thanks, this is just what I needed.

    ReplyDelete