Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

initial import

  • Loading branch information...
commit 0651a4adad8e118f215ed5477a34aa37298b85c0 0 parents
@groenewege authored
Showing with 42 additions and 0 deletions.
  1. 0  README.md
  2. +1 −0  ftdetect/less.vim
  3. +41 −0 syntax/less.vim
0  README.md
No changes.
1  ftdetect/less.vim
@@ -0,0 +1 @@
+autocmd BufNewFile,BufRead *.less setf less
41 syntax/less.vim
@@ -0,0 +1,41 @@
+if exists("b:current_syntax")
+ finish
+endif
+
+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"
+
Please sign in to comment.
Something went wrong with that request. Please try again.