annotate runtime/syntax/sass.vim @ 2603:ac0458d9b9dd v7.3.026

updated for version 7.3.026 Problem: CTRL-] in a help file doesn't always work. (Tony Mechelynck) Solution: Don't escape special characters. (Carlo Teubner)
author Bram Moolenaar <bram@vim.org>
date Wed, 13 Oct 2010 18:06:47 +0200
parents 713a4965ee7f
children 2eb30f341e8d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
1 " Vim syntax file
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
2 " Language: Sass
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
4 " Filenames: *.sass
2526
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2421
diff changeset
5 " Last Change: 2010 Aug 9
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
6
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
7 if exists("b:current_syntax")
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
8 finish
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
9 endif
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
10
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
11 runtime! syntax/css.vim
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
12
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
13 syn case ignore
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
14
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
15 syn cluster sassCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
16 syn cluster sassCssAttributes contains=css.*Attr,scssComment,cssValue.*,cssColor,cssURL,sassDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
17
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
18 syn region sassDefinition matchgroup=cssBraces start="{" end="}" contains=TOP
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
19
2421
c0e675a3e363 Minor runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 2415
diff changeset
20 syn match sassProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+:" contains=css.*Prop skipwhite nextgroup=sassCssAttribute contained containedin=sassDefinition
c0e675a3e363 Minor runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 2415
diff changeset
21 syn match sassProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
22 syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute
2526
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2421
diff changeset
23 syn match sassCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@sassCssAttributes,sassVariable,sassFunction,sassInterpolation
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
24 syn match sassDefault "!default\>" contained
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
25 syn match sassVariable "!\%(important\>\|default\>\)\@![[:alnum:]_-]\+"
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
26 syn match sassVariable "$[[:alnum:]_-]\+"
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
27 syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=\%(||\)\==" nextgroup=sassCssAttribute skipwhite
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
28 syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=:" nextgroup=sassCssAttribute skipwhite
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
29
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
30 syn match sassFunction "\<\%(rgb\|rgba\|red\|green\|blue\|mix\)\>(\@=" contained
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
31 syn match sassFunction "\<\%(hsl\|hsla\|hue\|saturation\|lightness\|adjust-hue\|lighten\|darken\|saturate\|desaturate\|grayscale\|complement\)\>(\@=" contained
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
32 syn match sassFunction "\<\%(alpha\|opacity\|rgba\|opacify\|fade-in\|transparentize\|fade-out\)\>(\@=" contained
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
33 syn match sassFunction "\<\%(unquote\|quote\)\>(\@=" contained
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
34 syn match sassFunction "\<\%(percentage\|round\|ceil\|floor\|abs\)\>(\@=" contained
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
35 syn match sassFunction "\<\%(type-of\|unit\|unitless\|comparable\)\>(\@=" contained
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
36
2526
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2421
diff changeset
37 syn region sassInterpolation matchgroup=sassInterpolationDelimiter start="#{" end="}" contains=@sassCssAttributes,sassVariable,sassFunction containedin=cssStringQ,cssStringQQ,sassProperty
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
38
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
39 syn match sassMixinName "[[:alnum:]_-]\+" contained nextgroup=sassCssAttribute
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
40 syn match sassMixin "^=" nextgroup=sassMixinName
2526
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2421
diff changeset
41 syn match sassMixin "\%([{};]\s*\|^\s*\)\@<=@mixin" nextgroup=sassMixinName skipwhite
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
42 syn match sassMixing "^\s\+\zs+" nextgroup=sassMixinName
2526
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2421
diff changeset
43 syn match sassMixing "\%([{};]\s*\|^\s*\)\@<=@include" nextgroup=sassMixinName skipwhite
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2421
diff changeset
44 syn match sassExtend "\%([{};]\s*\|^\s*\)\@<=@extend"
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
45
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
46 syn match sassEscape "^\s*\zs\\"
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
47 syn match sassIdChar "#[[:alnum:]_-]\@=" nextgroup=sassId
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
48 syn match sassId "[[:alnum:]_-]\+" contained
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
49 syn match sassClassChar "\.[[:alnum:]_-]\@=" nextgroup=sassClass
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
50 syn match sassClass "[[:alnum:]_-]\+" contained
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
51 syn match sassAmpersand "&"
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
52
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
53 " TODO: Attribute namespaces
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
54 " TODO: Arithmetic (including strings and concatenation)
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
55
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
56 syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssURL,cssUnicodeEscape,cssMediaType
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
57 syn region sassDebugLine end=";\|$" matchgroup=sassDebug start="@debug\>" contains=@sassCssAttributes,sassVariable,sassFunction
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
58 syn region sassWarnLine end=";\|$" matchgroup=sassWarn start="@warn\>" contains=@sassCssAttributes,sassVariable,sassFunction
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
59 syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\)\>" end="[{};]\@=\|$" contains=sassFor,@sassCssAttributes,sassVariable,sassFunction
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1668
diff changeset
60 syn keyword sassFor from to through contained
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
61
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
62 syn keyword sassTodo FIXME NOTE TODO OPTIMIZE XXX contained
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
63 syn region sassComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
64 syn region sassCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
65
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
66 hi def link sassCssComment sassComment
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
67 hi def link sassComment Comment
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
68 hi def link sassDefault cssImportant
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
69 hi def link sassVariable Identifier
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
70 hi def link sassFunction Function
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
71 hi def link sassMixing PreProc
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
72 hi def link sassMixin PreProc
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
73 hi def link sassExtend PreProc
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
74 hi def link sassTodo Todo
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
75 hi def link sassInclude Include
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
76 hi def link sassDebug sassControl
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
77 hi def link sassWarn sassControl
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1668
diff changeset
78 hi def link sassControl PreProc
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1668
diff changeset
79 hi def link sassFor PreProc
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
80 hi def link sassEscape Special
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
81 hi def link sassIdChar Special
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
82 hi def link sassClassChar Special
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
83 hi def link sassInterpolationDelimiter Delimiter
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
84 hi def link sassAmpersand Character
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
85 hi def link sassId Identifier
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
86 hi def link sassClass Type
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
87
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
88 let b:current_syntax = "sass"
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
89
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
90 " vim:set sw=2: