Browse files

initial import

  • Loading branch information...
groenewege committed May 17, 2011
0 parents commit 0651a4adad8e118f215ed5477a34aa37298b85c0
Showing with 42 additions and 0 deletions.
  1. 0
  2. +1 −0 ftdetect/less.vim
  3. +41 −0 syntax/less.vim
No changes.
@@ -0,0 +1 @@
+autocmd BufNewFile,BufRead *.less setf less
@@ -0,0 +1,41 @@
+if exists("b:current_syntax")
+ finish
+runtime! syntax/css.vim
+syn case ignore
+syn region lessDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssUrl,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,lessDefinition,lessComment,lessClassChar,lessVariable,lessMixinChar,lessAmpersandChar,lessFunction,@cssColors
+syn match lessVariable "@[[:alnum:]_-]\+" contained
+syn match lessVariable "@[[:alnum:]_-]\+" nextgroup=lessVariableAssignment
+syn match lessVariableAssignment ":" contained nextgroup=lessVariableValue
+syn match lessVariableValue ".*;"me=e-1 contained contains=lessVariable,lessOperator,lessDefault,@cssColors "me=e-1 means that the last char of the pattern is not highlighted
+syn match lessOperator "+" contained
+syn match lessOperator "-" contained
+syn match lessOperator "/" contained
+syn match lessOperator "*" contained
+syn match lessDefault "!default" contained
+syn match lessMixinChar "\.[[:alnum:]_-]\@=" contained nextgroup=lessClass
+syn match lessAmpersandChar "&" contained nextgroup=lessClass,cssPseudoClass
+syn match lessClass "[[:alnum:]_-]\+" contained
+syn keyword lessFunction lighten darken saturate desaturate fadein fadeout spin hue saturation lightness containedin=cssDefinition contained
+syn match lessComment "//.*$" contains=@Spell
+hi def link lessVariable Special
+hi def link lessVariableValue Constant
+hi def link lessDefault Special
+hi def link lessComment Comment
+hi def link lessFunction Function
+hi def link lessMixinChar Special
+hi def link lessAmpersandChar Special
+hi def link lessClass PreProc
+let b:current_syntax = "less"

0 comments on commit 0651a4a

Please sign in to comment.