@@ -0,0 +1,91 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: VimL
5+file_extensions:
6+ - vim
7+ - .vimrc
8+scope: source.viml
9+contexts:
10+ main:
11+ - include: comment
12+ - include: string_quoted_double
13+ - include: string_quoted_single
14+ - include: string_regex
15+ - include: inline_comment
16+ - include: number_int
17+ - include: number_hex
18+ - include: keyword
19+ - include: support_function
20+ - include: support_variable
21+ - include: support_type
22+ - include: function_params
23+ - include: function_definition
24+ - include: function_call
25+ - include: function
26+ - include: variable
27+ - include: expr
28+ comment:
29+ - match: ^\s*".*$
30+ scope: comment.line.quotes.viml
31+ captures:
32+ 1: punctuation.definition.comment.vim
33+ expr:
34+ - match: (\|\||&&|==(\?|#)?|(!|>|<)=(#|\?)?|(=|!)~(#|\?)?|(>|<)(#|\?)is|isnot|\.|\*|\\|%)
35+ scope: storage.function.viml
36+ function:
37+ - match: \b(fu(n|nction)?|end(f|fu|fun|function)?)\b
38+ scope: storage.function.viml
39+ function_call:
40+ - match: '(([sgbwtl]|)?:?[0-9a-zA-Z_#]+)(?=\()'
41+ scope: support.function.any-method
42+ function_definition:
43+ - match: '^\s*(function)\s*!?\s+(?=(s:)?[0-9a-zA-Z_#]+\s*\()'
44+ captures:
45+ 1: storage.function.viml
46+ push:
47+ - meta_scope: meta.function.viml
48+ - match: (\()
49+ captures:
50+ 1: punctuation.definition.parameters.begin.viml
51+ pop: true
52+ - match: "(s:)?[0-9a-zA-Z_#]+"
53+ scope: entity.name.function.viml
54+ function_params:
55+ - match: '-\w+='
56+ scope: support.type.viml
57+ inline_comment:
58+ - match: '(?!\$)(")(?!\{).*$\n?'
59+ scope: comment.line.quotes.viml
60+ captures:
61+ 1: punctuation.definition.comment.vim
62+ keyword:
63+ - match: \b(if|while|for|try|return|throw|end(if|for|while|try)?|au(g|group)|else(if|)?|do|in|catch|finally|:)\b
64+ scope: keyword.control.viml
65+ number_hex:
66+ - match: "#[0-9a-f]{6}"
67+ scope: constant.numeric.hex
68+ number_int:
69+ - match: '-?\d+'
70+ scope: constant.numeric.integer
71+ string_quoted_double:
72+ - match: '"(\\\\|\\"|\n[^\S\n]*\\|[^\n"])*"'
73+ scope: string.quoted.double.viml
74+ string_quoted_single:
75+ - match: '''(''''|\n[^\S\n]*\\|[^\n''])*'''
76+ scope: string.quoted.single.viml
77+ string_regex:
78+ - match: '/(\\\\|\\/|\n[^\S\n]*\\|[^\n/])*/'
79+ scope: string.regexp.viml
80+ support_function:
81+ - match: \b(set(local|global)?|let|command|filetype|colorscheme|\w*map|\w*a(b|brev)?|syn|exe(c|cute)?|ec(ho|)?|au(tocmd|)?)\b
82+ scope: support.function.viml
83+ support_type:
84+ - match: <.*?>
85+ scope: support.type.viml
86+ support_variable:
87+ - match: '\b(am(enu|)?|(hl|inc)?search|[Bb]uf([Nn]ew[Ff]ile|[Rr]ead)?|[Ff]ile[Tt]ype)\b'
88+ scope: support.variable.viml
89+ variable:
90+ - match: '([sSgGbBwWlLaAvV]:|@|$|&(?!&))\w*'
91+ scope: variable.other.viml