1668
|
1 " Vim syntax file
|
|
2 " Language: Sass
|
2202
|
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
1668
|
4 " Filenames: *.sass
|
2202
|
5 " Last Change: 2010 May 21
|
1668
|
6
|
|
7 if exists("b:current_syntax")
|
|
8 finish
|
|
9 endif
|
|
10
|
|
11 runtime! syntax/css.vim
|
|
12
|
|
13 syn case ignore
|
|
14
|
|
15 syn cluster sassCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp
|
|
16 syn cluster sassCssAttributes contains=css.*Attr,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp
|
|
17
|
|
18 syn match sassProperty "^\s*\zs\s\%([[:alnum:]-]\+:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute
|
2202
|
19 syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassScript
|
1668
|
20 syn match sassCssAttribute ".*$" contained contains=@sassCssAttributes,sassConstant
|
2202
|
21 syn match sassScript ".*$" contained contains=@sassCssAttributes,sassConstant
|
1668
|
22 syn match sassConstant "![[:alnum:]_-]\+"
|
2202
|
23 syn match sassConstantAssignment "\%(![[:alnum:]_]\+\s*\)\@<=\%(||\)\==" nextgroup=sassScript skipwhite
|
1668
|
24 syn match sassMixin "^=.*"
|
|
25 syn match sassMixing "^\s\+\zs+.*"
|
|
26
|
|
27 syn match sassEscape "^\s*\zs\\"
|
|
28 syn match sassIdChar "#[[:alnum:]_-]\@=" nextgroup=sassId
|
|
29 syn match sassId "[[:alnum:]_-]\+" contained
|
|
30 syn match sassClassChar "\.[[:alnum:]_-]\@=" nextgroup=sassClass
|
|
31 syn match sassClass "[[:alnum:]_-]\+" contained
|
|
32 syn match sassAmpersand "&"
|
|
33
|
|
34 " TODO: Attribute namespaces
|
|
35 " TODO: Arithmetic (including strings and concatenation)
|
|
36
|
|
37 syn region sassInclude start="@import" end=";\|$" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType
|
2202
|
38 syn region sassDebugLine matchgroup=sassDebug start="@debug\>" end="$" contains=@sassCssAttributes,sassConstant
|
|
39 syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\)\>" end="$" contains=sassFor,@sassCssAttributes,sassConstant
|
|
40 syn keyword sassFor from to through contained
|
1668
|
41
|
|
42 syn keyword sassTodo FIXME NOTE TODO OPTIMIZE XXX contained
|
|
43 syn region sassComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=sassTodo
|
|
44 syn region sassCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo
|
|
45
|
|
46 hi def link sassCssComment sassComment
|
|
47 hi def link sassComment Comment
|
|
48 hi def link sassConstant Identifier
|
|
49 hi def link sassMixing PreProc
|
|
50 hi def link sassMixin PreProc
|
|
51 hi def link sassTodo Todo
|
|
52 hi def link sassInclude Include
|
2202
|
53 hi def link sassDebug Debug
|
|
54 hi def link sassControl PreProc
|
|
55 hi def link sassFor PreProc
|
1668
|
56 hi def link sassEscape Special
|
|
57 hi def link sassIdChar Special
|
|
58 hi def link sassClassChar Special
|
|
59 hi def link sassAmpersand Character
|
|
60 hi def link sassId Identifier
|
|
61 hi def link sassClass Type
|
|
62
|
|
63 let b:current_syntax = "sass"
|
|
64
|
|
65 " vim:set sw=2:
|