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