annotate vendor/vim-syntax/slim.vim @ 601:cd80bafc1257

Remove license
author nanaya <me@nanaya.pro>
date Mon, 10 Apr 2017 23:18:23 +0900
parents 7fbadf8bd22e
children c548e83e4c57
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
475
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
1 " Vim syntax file
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
2 " Language: Slim
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
3 " Maintainer: Andrew Stone <andy@stonean.com>
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
4 " Version: 1
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
5 " Last Change: 2010 Sep 25
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
6 " TODO: Feedback is welcomed.
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
7
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
8 " Quit when a syntax file is already loaded.
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
9 if exists("b:current_syntax")
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
10 finish
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
11 endif
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
12
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
13 if !exists("main_syntax")
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
14 let main_syntax = 'slim'
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
15 endif
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
16
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
17 " Allows a per line syntax evaluation.
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
18 let b:ruby_no_expensive = 1
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
19
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
20 " Include Ruby syntax highlighting
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
21 syn include @slimRubyTop syntax/ruby.vim
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
22 unlet! b:current_syntax
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
23 " Include Haml syntax highlighting
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
24 syn include @slimHaml syntax/haml.vim
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
25 unlet! b:current_syntax
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
26
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
27 syn match slimBegin "^\s*\(&[^= ]\)\@!" nextgroup=slimTag,slimClassChar,slimIdChar,slimRuby
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
28
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
29 syn region rubyCurlyBlock start="{" end="}" contains=@slimRubyTop contained
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
30 syn cluster slimRubyTop add=rubyCurlyBlock
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
31
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
32 syn cluster slimComponent contains=slimClassChar,slimIdChar,slimWrappedAttrs,slimRuby,slimAttr,slimInlineTagChar
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
33
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
34 syn keyword slimDocType contained html 5 1.1 strict frameset mobile basic transitional
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
35 syn match slimDocTypeKeyword "^\s*\(doctype\)\s\+" nextgroup=slimDocType
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
36
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
37 syn keyword slimTodo FIXME TODO NOTE OPTIMIZE XXX contained
508
bbcffc594d1e Vendor what should be vendored and add some more.
edogawaconan <me@myconan.net>
parents: 475
diff changeset
38 syn keyword htmlTagName contained script
475
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
39
508
bbcffc594d1e Vendor what should be vendored and add some more.
edogawaconan <me@myconan.net>
parents: 475
diff changeset
40 syn match slimTag "\w\+[><]*" contained contains=htmlTagName nextgroup=@slimComponent
475
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
41 syn match slimIdChar "#{\@!" contained nextgroup=slimId
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
42 syn match slimId "\%(\w\|-\)\+" contained nextgroup=@slimComponent
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
43 syn match slimClassChar "\." contained nextgroup=slimClass
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
44 syn match slimClass "\%(\w\|-\)\+" contained nextgroup=@slimComponent
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
45 syn match slimInlineTagChar "\s*:\s*" contained nextgroup=slimTag,slimClassChar,slimIdChar
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
46
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
47 syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*{\s*" skip="}\s*\"" end="\s*}\s*" contained contains=slimAttr nextgroup=slimRuby
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
48 syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*\[\s*" end="\s*\]\s*" contained contains=slimAttr nextgroup=slimRuby
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
49 syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*(\s*" end="\s*)\s*" contained contains=slimAttr nextgroup=slimRuby
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
50
537
351bd965bc1f Update some syntax files.
edogawaconan <me@myconan.net>
parents: 508
diff changeset
51 syn match slimAttr /\s*\%(\w\|-\)\+\s*=/me=e-1 contained contains=htmlArg nextgroup=slimAttrAssignment
475
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
52 syn match slimAttrAssignment "\s*=\s*" contained nextgroup=slimWrappedAttrValue,slimAttrString
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
53
537
351bd965bc1f Update some syntax files.
edogawaconan <me@myconan.net>
parents: 508
diff changeset
54 syn region slimWrappedAttrValue start="[^"']" end="\s\|$" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar
475
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
55 syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="{" end="}" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
56 syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="\[" end="\]" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
57 syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="(" end=")" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
58
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
59 syn region slimAttrString start=+\s*"+ skip=+\%(\\\\\)*\\"+ end=+"\s*+ contained contains=slimInterpolation,slimInterpolationEscape nextgroup=slimAttr,slimRuby,slimInlineTagChar
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
60 syn region slimAttrString start=+\s*'+ skip=+\%(\\\\\)*\\"+ end=+'\s*+ contained contains=slimInterpolation,slimInterpolationEscape nextgroup=slimAttr,slimRuby,slimInlineTagChar
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
61
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
62 syn region slimInnerAttrString start=+\s*"+ skip=+\%(\\\\\)*\\"+ end=+"\s*+ contained contains=slimInterpolation,slimInterpolationEscape nextgroup=slimAttr
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
63 syn region slimInnerAttrString start=+\s*'+ skip=+\%(\\\\\)*\\"+ end=+'\s*+ contained contains=slimInterpolation,slimInterpolationEscape nextgroup=slimAttr
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
64
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
65 syn region slimInterpolation matchgroup=slimInterpolationDelimiter start="#{" end="}" contains=@hamlRubyTop containedin=javascriptStringS,javascriptStringD,slimWrappedAttrs
508
bbcffc594d1e Vendor what should be vendored and add some more.
edogawaconan <me@myconan.net>
parents: 475
diff changeset
66 syn region slimInterpolation matchgroup=slimInterpolationDelimiter start="#{{" end="}}" contains=@hamlRubyTop containedin=javascriptStringS,javascriptStringD,slimWrappedAttrs
475
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
67 syn match slimInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
68
589
7fbadf8bd22e Update vendor
nanaya <me@myconan.net>
parents: 537
diff changeset
69 syn region slimPlainFilter matchgroup=slimFilter start="^\z(\s*\)\%(rdoc\|textile\|markdown\|wiki\):\s*$" end="^\%(\z1 \| *$\)\@!"
7fbadf8bd22e Update vendor
nanaya <me@myconan.net>
parents: 537
diff changeset
70 syn region slimJavascriptFilter matchgroup=slimFilter start="^\z(\s*\)javascript:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlJavaScript,slimInterpolation keepend
7fbadf8bd22e Update vendor
nanaya <me@myconan.net>
parents: 537
diff changeset
71 syn region slimCoffeeFilter matchgroup=slimFilter start="^\z(\s*\)coffee:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@coffeeAll,slimInterpolation keepend
7fbadf8bd22e Update vendor
nanaya <me@myconan.net>
parents: 537
diff changeset
72 syn region slimCSSFilter matchgroup=slimFilter start="^\z(\s*\)css:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlCss,slimInterpolation keepend
7fbadf8bd22e Update vendor
nanaya <me@myconan.net>
parents: 537
diff changeset
73 syn region slimSassFilter matchgroup=slimFilter start="^\z(\s*\)sass:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlSassTop
7fbadf8bd22e Update vendor
nanaya <me@myconan.net>
parents: 537
diff changeset
74
537
351bd965bc1f Update some syntax files.
edogawaconan <me@myconan.net>
parents: 508
diff changeset
75 syn region slimRuby matchgroup=slimRubyOutputChar start="\s*[=]\==[']\=" skip="\%\(,\s*\|\\\)$" end="$" contained contains=@slimRubyTop keepend
351bd965bc1f Update some syntax files.
edogawaconan <me@myconan.net>
parents: 508
diff changeset
76 syn region slimRuby matchgroup=slimRubyChar start="\s*-" skip="\%\(,\s*\|\\\)$" end="$" contained contains=@slimRubyTop keepend
475
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
77
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
78 syn match slimComment /^\(\s*\)[/].*\(\n\1\s.*\)*/ contains=slimTodo
537
351bd965bc1f Update some syntax files.
edogawaconan <me@myconan.net>
parents: 508
diff changeset
79 syn match slimText /^\(\s*\)[`|'].*\(\n\1\s.*\)*/ contains=slimInterpolation
475
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
80
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
81 syn match slimFilter /\s*\w\+:\s*/ contained
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
82 syn match slimHaml /^\(\s*\)\<haml:\>.*\(\n\1\s.*\)*/ contains=@slimHaml,slimFilter
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
83
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
84 syn match slimIEConditional "\%(^\s*/\)\@<=\[\s*if\>[^]]*]" contained containedin=slimComment
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
85
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
86 hi def link slimAttrString String
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
87 hi def link slimBegin String
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
88 hi def link slimClass Type
508
bbcffc594d1e Vendor what should be vendored and add some more.
edogawaconan <me@myconan.net>
parents: 475
diff changeset
89 hi def link slimAttr Type
475
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
90 hi def link slimClassChar Type
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
91 hi def link slimComment Comment
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
92 hi def link slimDocType Identifier
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
93 hi def link slimDocTypeKeyword Keyword
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
94 hi def link slimFilter Keyword
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
95 hi def link slimIEConditional SpecialComment
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
96 hi def link slimId Identifier
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
97 hi def link slimIdChar Identifier
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
98 hi def link slimInnerAttrString String
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
99 hi def link slimInterpolationDelimiter Delimiter
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
100 hi def link slimRubyChar Special
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
101 hi def link slimRubyOutputChar Special
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
102 hi def link slimText String
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
103 hi def link slimTodo Todo
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
104 hi def link slimWrappedAttrValueDelimiter Delimiter
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
105 hi def link slimWrappedAttrsDelimiter Delimiter
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
106 hi def link slimInlineTagChar Delimiter
589
7fbadf8bd22e Update vendor
nanaya <me@myconan.net>
parents: 537
diff changeset
107 hi def link slimFilter PreProc
475
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
108
86873b811343 Add slim syntax to vim.
edogawaconan <me@myconan.net>
parents:
diff changeset
109 let b:current_syntax = "slim"