comparison vendor/vim-syntax/less.vim @ 589:7fbadf8bd22e

Update vendor Change whatever available from official vim
author nanaya <me@myconan.net>
date Thu, 07 Jul 2016 15:59:06 +0900
parents 50fd59a959ea
children a6bbbee07a3a
comparison
equal deleted inserted replaced
588:152c020d7d8e 589:7fbadf8bd22e
1 " Vim syntax file
2 " Language: less
3 " Maintainer: Alessandro Vioni <jenoma@gmail.com>
4 " URL: https://github.com/genoma/vim-less
5 " Last Change: 2014 November 24
6
1 if exists("b:current_syntax") 7 if exists("b:current_syntax")
2 finish 8 finish
3 endif 9 endif
4 10
5 runtime! syntax/css.vim 11 runtime! syntax/css.vim
6 runtime! after/syntax/css.vim 12 runtime! after/syntax/css.vim
7 " load files from vim-css3-syntax plugin (https://github.com/hail2u/vim-css3-syntax)
8 runtime! after/syntax/css/*.vim
9 13
10 syn case ignore 14 syn case ignore
11 15
12 syn region lessDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssTagName,cssPseudoClass,cssUrl,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,lessDefinition,lessComment,lessClassChar,lessVariable,lessMixinChar,lessAmpersandChar,lessFunction,lessNestedSelector,@cssColors fold 16 syn cluster lessCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp
17 syn cluster lessCssAttributes contains=css.*Attr,lessEndOfLineComment,lessComment,cssValue.*,cssColor,cssURL,lessDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp
13 18
14 syn match lessVariable "@[[:alnum:]_-]\+" contained 19 syn region lessDefinition matchgroup=cssBraces start="{" end="}" contains=TOP
15 syn match lessVariable "@[[:alnum:]_-]\+" nextgroup=lessVariableAssignment skipwhite
16 syn match lessVariableAssignment ":" contained nextgroup=lessVariableValue skipwhite
17 syn match lessVariableValue ".*;"me=e-1 contained contains=lessVariable,lessOperator,lessDefault,cssValue.*,@cssColors "me=e-1 means that the last char of the pattern is not highlighted
18 20
19 syn match lessOperator "+" contained 21 syn match lessProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:" contains=css.*Prop skipwhite nextgroup=lessCssAttribute contained containedin=lessDefinition
20 syn match lessOperator "-" contained 22 syn match lessProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=lessCssAttribute
21 syn match lessOperator "/" contained 23 syn match lessProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=lessCssAttribute
22 syn match lessOperator "*" contained 24 syn match lessCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@lessCssAttributes,lessVariable,lessFunction,lessInterpolation
25 syn match lessDefault "!default\>" contained
23 26
24 syn match lessNestedSelector "[^/]* {"me=e-1 contained contains=cssTagName,cssAttributeSelector,lessAmpersandChar,lessVariable,lessMixinChar,lessFunction,lessNestedProperty 27 " less variables and media queries
25 syn match lessNestedProperty "[[:alnum:]]\+:"me=e-1 contained 28 syn match lessVariable "@[[:alnum:]_-]\+" nextgroup=lessCssAttribute skipwhite
29 syn match lessMedia "@media" nextgroup=lessCssAttribute skipwhite
26 30
27 syn match lessDefault "!default" contained 31 " Less functions
32 syn match lessFunction "\<\%(escape\|e\|unit\)\>(\@=" contained
33 syn match lessFunction "\<\%(ceil\|floor\|percentage\|round\|sqrt\|abs\|sin\|asin\|cos\|acos\|tan\|atan\|pi\|pow\|min\|max\)\>(\@=" contained
34 syn match lessFunction "\<\%(rgb\|rgba\|argb\|argb\|hsl\|hsla\|hsv\|hsva\)\>(\@=" contained
35 syn match lessFunction "\<\%(hue\|saturation\|lightness\|red\|green\|blue\|alpha\|luma\)\>(\@=" contained
36 syn match lessFunction "\<\%(saturate\|desaturate\|lighten\|darken\|fadein\|fadeout\|fade\|spin\|mix\|greyscale\|contrast\)\>(\@=" contained
37 syn match lessFunction "\<\%(multiply\|screen\|overlay\|softlight\|hardlight\|difference\|exclusion\|average\|negation\)\>(\@=" contained
28 38
29 syn match lessMixinChar "\.[[:alnum:]_-]\@=" contained nextgroup=lessClass 39 " Less id class visualization
30 syn match lessAmpersandChar "&" contained nextgroup=lessClass,cssPseudoClass 40 syn match lessIdChar "#[[:alnum:]_-]\@=" nextgroup=lessId,lessClassIdCall
31 syn match lessClass "[[:alnum:]_-]\+" contained 41 syn match lessId "[[:alnum:]_-]\+" contained
42 syn match lessClassIdCall "[[:alnum:]_-]\+()" contained
32 43
33 " functions {{{ 44 syn match lessClassChar "\.[[:alnum:]_-]\@=" nextgroup=lessClass,lessClassCall
45 syn match lessClass "[[:alnum:]_-]\+" contained
46 syn match lessClassCall "[[:alnum:]_-]\+()" contained
34 47
35 " string functions 48 syn match lessAmpersand "&" contains=lessIdChar,lessClassChar
36 syn keyword lessFunction escape e % containedin=cssDefinition contained
37 " misc functions
38 syn keyword lessFunction unit containedin=cssDefinition contained
39 " math functions
40 syn keyword lessFunction ceil floor percentage round containedin=cssDefinition contained
41 " color definition
42 syn keyword lessFunction rgb rgba argb hsl hsla hsv hsva containedin=cssDefinition contained
43 " color channel information
44 syn keyword lessFunction hue saturation lightness red green blue alpha luma containedin=cssDefinition contained
45 " color operations
46 syn keyword lessFunction saturate desaturate lighten darken fadein fadeout fade spin mix greyscale contrast containedin=cssDefinition contained
47 " color blending
48 syn keyword lessFunction multiply screen overlay softlight hardlight difference exclusion average negation containedin=cssDefinition contained
49 49
50 " }}} 50 syn region lessInclude start="@import" end=";\|$" contains=lessComment,cssURL,cssUnicodeEscape,cssMediaType,cssStringQ,cssStringQQ
51 51
52 syn match lessComment "//.*$" contains=@Spell 52 syn keyword lessTodo FIXME NOTE TODO OPTIMIZE XXX contained
53 syn region lessComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=lessTodo,@Spell
54 syn region lessCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=lessTodo,@Spell
55 syn match lessEndOfLineComment "//.*" contains=lessComment,lessTodo,@Spell
53 56
54 hi def link lessVariable Special 57 hi def link lessEndOfLineComment lessComment
55 hi def link lessVariableValue Constant 58 hi def link lessCssComment lessComment
56 hi def link lessDefault Special 59 hi def link lessComment Comment
57 hi def link lessComment Comment 60 hi def link lessDefault cssImportant
58 hi def link lessFunction Function 61 hi def link lessVariable Identifier
59 hi def link lessMixinChar Special 62 hi def link lessFunction PreProc
60 hi def link lessAmpersandChar Special 63 hi def link lessTodo Todo
61 hi def link lessNestedProperty Type 64 hi def link lessInclude Include
62 hi def link lessClass PreProc 65 hi def link lessIdChar Special
66 hi def link lessClassChar Special
67 hi def link lessAmpersand Character
68 hi def link lessId Identifier
69 hi def link lessClass Type
70 hi def link lessCssAttribute PreProc
71 hi def link lessClassCall Type
72 hi def link lessClassIdCall Type
73 hi def link lessTagName cssTagName
74 hi def link lessDeprecated cssDeprecated
75 hi def link lessMedia cssMedia
63 76
64 let b:current_syntax = "less" 77 let b:current_syntax = "less"
78
79 " vim:set sw=2: