summaryrefslogtreecommitdiff
path: root/runtime/syntax/sass.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-07-13 17:41:49 +0000
committerBram Moolenaar <Bram@vim.org>2008-07-13 17:41:49 +0000
commitc236c16d0884c7d6cdc4dbaddb8cb3992085f83e (patch)
tree7d87344cdf07b6b9234abe26ccef39fbbee54f63 /runtime/syntax/sass.vim
parentb316376b4893ac3ae62f7f33c483b28b7fc147c0 (diff)
downloadvim-git-c236c16d0884c7d6cdc4dbaddb8cb3992085f83e.tar.gz
updated for version 7.2b-000v7.2b.000
Diffstat (limited to 'runtime/syntax/sass.vim')
-rw-r--r--runtime/syntax/sass.vim56
1 files changed, 56 insertions, 0 deletions
diff --git a/runtime/syntax/sass.vim b/runtime/syntax/sass.vim
new file mode 100644
index 000000000..1a2e7a450
--- /dev/null
+++ b/runtime/syntax/sass.vim
@@ -0,0 +1,56 @@
+" Vim syntax file
+" Language: Sass
+" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
+" Filenames: *.sass
+
+if exists("b:current_syntax")
+ finish
+endif
+
+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 match sassProperty "^\s*\zs\s\%([[:alnum:]-]\+:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute
+syn match sassCssAttribute ".*$" contained contains=@sassCssAttributes,sassConstant
+syn match sassConstant "![[:alnum:]_-]\+"
+syn match sassConstantAssignment "\%(![[:alnum:]_]\+\s*\)\@<==" nextgroup=sassCssAttribute skipwhite
+syn match sassMixin "^=.*"
+syn match sassMixing "^\s\+\zs+.*"
+
+syn match sassEscape "^\s*\zs\\"
+syn match sassIdChar "#[[:alnum:]_-]\@=" nextgroup=sassId
+syn match sassId "[[:alnum:]_-]\+" contained
+syn match sassClassChar "\.[[:alnum:]_-]\@=" nextgroup=sassClass
+syn match sassClass "[[:alnum:]_-]\+" contained
+syn match sassAmpersand "&"
+
+" TODO: Attribute namespaces
+" TODO: Arithmetic (including strings and concatenation)
+
+syn region sassInclude start="@import" end=";\|$" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType
+
+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
+
+hi def link sassCssComment sassComment
+hi def link sassComment Comment
+hi def link sassConstant Identifier
+hi def link sassMixing PreProc
+hi def link sassMixin PreProc
+hi def link sassTodo Todo
+hi def link sassInclude Include
+hi def link sassEscape Special
+hi def link sassIdChar Special
+hi def link sassClassChar Special
+hi def link sassAmpersand Character
+hi def link sassId Identifier
+hi def link sassClass Type
+
+let b:current_syntax = "sass"
+
+" vim:set sw=2: