summaryrefslogtreecommitdiff
path: root/runtime/syntax
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-07-26 22:21:27 +0200
committerBram Moolenaar <Bram@vim.org>2010-07-26 22:21:27 +0200
commit0ed0eea20689b3bdafe296f4e132679d3977b943 (patch)
tree98c323889cb76e5475f62983f79717c7b30adff8 /runtime/syntax
parentf82bac371703d25bf94d3a91bc68413d3f734be7 (diff)
downloadvim-0ed0eea20689b3bdafe296f4e132679d3977b943.zip
Updated runtime files.
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/haml.vim10
-rw-r--r--runtime/syntax/sass.vim64
-rw-r--r--runtime/syntax/scss.vim20
3 files changed, 70 insertions, 24 deletions
diff --git a/runtime/syntax/haml.vim b/runtime/syntax/haml.vim
index bb144bad0..f49eaca98 100644
--- a/runtime/syntax/haml.vim
+++ b/runtime/syntax/haml.vim
@@ -1,8 +1,8 @@
" Vim syntax file
-" Language: Haml
-" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Filenames: *.haml
-" Last Change: 2010 May 21
+" Language: Haml
+" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
+" Filenames: *.haml
+" Last Change: 2010 Jul 26
if exists("b:current_syntax")
finish
@@ -30,7 +30,7 @@ syn cluster hamlTop contains=hamlBegin,hamlPlainFilter,hamlRubyFilter,h
syn match hamlBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=hamlTag,hamlClassChar,hamlIdChar,hamlRuby,hamlPlainChar,hamlInterpolatable
-syn match hamlTag "%\w\+" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@hamlComponent
+syn match hamlTag "%\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@hamlComponent
syn region hamlAttributes matchgroup=hamlAttributesDelimiter start="(" end=")" contained contains=htmlArg,hamlAttributeString,hamlAttributeVariable,htmlEvent,htmlCssDefinition nextgroup=@hamlComponent
syn region hamlAttributesHash matchgroup=hamlAttributesDelimiter start="{" end="}" contained contains=@hamlRubyTop nextgroup=@hamlComponent
syn region hamlObject matchgroup=hamlObjectDelimiter start="\[" end="\]" contained contains=@hamlRubyTop nextgroup=@hamlComponent
diff --git a/runtime/syntax/sass.vim b/runtime/syntax/sass.vim
index 5bee495c0..082ae71bd 100644
--- a/runtime/syntax/sass.vim
+++ b/runtime/syntax/sass.vim
@@ -1,8 +1,8 @@
" Vim syntax file
-" Language: Sass
-" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Filenames: *.sass
-" Last Change: 2010 May 21
+" Language: Sass
+" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
+" Filenames: *.sass
+" Last Change: 2010 Jul 26
if exists("b:current_syntax")
finish
@@ -13,16 +13,36 @@ runtime! syntax/css.vim
syn case ignore
syn cluster sassCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp
-syn cluster sassCssAttributes contains=css.*Attr,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp
+syn cluster sassCssAttributes contains=css.*Attr,scssComment,cssValue.*,cssColor,cssURL,sassDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp
+syn region sassDefinition matchgroup=cssBraces start="{" end="}" contains=TOP
+
+syn match sassProperty "\%([{};]\s*\|^\)\@<=[[:alnum:]-]\+:" contains=css.*Prop skipwhite nextgroup=sassCssAttribute contained containedin=sassDefinition
syn match sassProperty "^\s*\zs\s\%([[:alnum:]-]\+:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute
-syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassScript
-syn match sassCssAttribute ".*$" contained contains=@sassCssAttributes,sassConstant
-syn match sassScript ".*$" contained contains=@sassCssAttributes,sassConstant
-syn match sassConstant "![[:alnum:]_-]\+"
-syn match sassConstantAssignment "\%(![[:alnum:]_]\+\s*\)\@<=\%(||\)\==" nextgroup=sassScript skipwhite
-syn match sassMixin "^=.*"
-syn match sassMixing "^\s\+\zs+.*"
+syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute
+syn match sassCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|[^{};]\)*+ contained contains=@sassCssAttributes,sassVariable,sassFunction
+syn match sassDefault "!default\>" contained
+syn match sassVariable "!\%(important\>\|default\>\)\@![[:alnum:]_-]\+"
+syn match sassVariable "$[[:alnum:]_-]\+"
+syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=\%(||\)\==" nextgroup=sassCssAttribute skipwhite
+syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=:" nextgroup=sassCssAttribute skipwhite
+
+syn match sassFunction "\<\%(rgb\|rgba\|red\|green\|blue\|mix\)\>(\@=" contained
+syn match sassFunction "\<\%(hsl\|hsla\|hue\|saturation\|lightness\|adjust-hue\|lighten\|darken\|saturate\|desaturate\|grayscale\|complement\)\>(\@=" contained
+syn match sassFunction "\<\%(alpha\|opacity\|rgba\|opacify\|fade-in\|transparentize\|fade-out\)\>(\@=" contained
+syn match sassFunction "\<\%(unquote\|quote\)\>(\@=" contained
+syn match sassFunction "\<\%(percentage\|round\|ceil\|floor\|abs\)\>(\@=" contained
+syn match sassFunction "\<\%(type-of\|unit\|unitless\|comparable\)\>(\@=" contained
+
+syn region sassInterpolation matchgroup=sassInterpolationDelimiter start="#{" end="}" contains=@sassCssAttributes,sassVariable,sassFunction containedin=cssStringQ,cssStringQQ
+
+syn match sassMixinName "[[:alnum:]_-]\+" contained nextgroup=sassCssAttribute
+syn match sassMixin "^=" nextgroup=sassMixinName
+syn match sassMixin "^\s*\zs@mixin" nextgroup=sassMixinName skipwhite
+syn match sassMixing "^\s\+\zs+" nextgroup=sassMixinName
+syn match sassMixing "^\s\+\zs@include" nextgroup=sassMixinName skipwhite
+syn match sassMixing "\%([{};]\s*\|^\)\@<=@include" nextgroup=sassMixinName skipwhite contained containedin=sassDefinition
+syn match sassExtend "^\s\+\zs@extend"
syn match sassEscape "^\s*\zs\\"
syn match sassIdChar "#[[:alnum:]_-]\@=" nextgroup=sassId
@@ -34,28 +54,34 @@ syn match sassAmpersand "&"
" TODO: Attribute namespaces
" TODO: Arithmetic (including strings and concatenation)
-syn region sassInclude start="@import" end=";\|$" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType
-syn region sassDebugLine matchgroup=sassDebug start="@debug\>" end="$" contains=@sassCssAttributes,sassConstant
-syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\)\>" end="$" contains=sassFor,@sassCssAttributes,sassConstant
+syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssURL,cssUnicodeEscape,cssMediaType
+syn region sassDebugLine end=";\|$" matchgroup=sassDebug start="@debug\>" contains=@sassCssAttributes,sassVariable,sassFunction
+syn region sassWarnLine end=";\|$" matchgroup=sassWarn start="@warn\>" contains=@sassCssAttributes,sassVariable,sassFunction
+syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\)\>" end="[{};]\@=\|$" contains=sassFor,@sassCssAttributes,sassVariable,sassFunction
syn keyword sassFor from to through contained
syn keyword sassTodo FIXME NOTE TODO OPTIMIZE XXX contained
-syn region sassComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=sassTodo
-syn region sassCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo
+syn region sassComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell
+syn region sassCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell
hi def link sassCssComment sassComment
hi def link sassComment Comment
-hi def link sassConstant Identifier
+hi def link sassDefault cssImportant
+hi def link sassVariable Identifier
+hi def link sassFunction Function
hi def link sassMixing PreProc
hi def link sassMixin PreProc
+hi def link sassExtend PreProc
hi def link sassTodo Todo
hi def link sassInclude Include
-hi def link sassDebug Debug
+hi def link sassDebug sassControl
+hi def link sassWarn sassControl
hi def link sassControl PreProc
hi def link sassFor PreProc
hi def link sassEscape Special
hi def link sassIdChar Special
hi def link sassClassChar Special
+hi def link sassInterpolationDelimiter Delimiter
hi def link sassAmpersand Character
hi def link sassId Identifier
hi def link sassClass Type
diff --git a/runtime/syntax/scss.vim b/runtime/syntax/scss.vim
new file mode 100644
index 000000000..6fb969152
--- /dev/null
+++ b/runtime/syntax/scss.vim
@@ -0,0 +1,20 @@
+" Vim syntax file
+" Language: SCSS
+" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
+" Filenames: *.scss
+" Last Change: 2010 Jul 26
+
+if exists("b:current_syntax")
+ finish
+endif
+
+runtime! syntax/sass.vim
+
+syn match scssComment "//.*" contains=sassTodo,@Spell
+syn region scssComment start="/\*" end="\*/" contains=sassTodo,@Spell
+
+hi def link scssComment sassComment
+
+let b:current_syntax = "scss"
+
+" vim:set sw=2: