389
|
1 " Vim syntax file
|
11062
|
2 " Language: nanorc(5) - GNU nano configuration file
|
|
3 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
|
4 " Latest Revision: 2006-04-19
|
389
|
5
|
|
6 if exists("b:current_syntax")
|
|
7 finish
|
|
8 endif
|
|
9
|
|
10 let s:cpo_save = &cpo
|
|
11 set cpo&vim
|
|
12
|
|
13 syn keyword nanorcTodo contained TODO FIXME XXX NOTE
|
|
14
|
|
15 syn region nanorcComment display oneline start='^\s*#' end='$'
|
|
16 \ contains=nanorcTodo,@Spell
|
|
17
|
|
18 syn match nanorcBegin display '^'
|
|
19 \ nextgroup=nanorcKeyword,nanorcComment
|
|
20 \ skipwhite
|
|
21
|
|
22 syn keyword nanorcKeyword contained set unset
|
|
23 \ nextgroup=nanorcBoolOption,
|
|
24 \ nanorcStringOption,nanorcNumberOption
|
|
25 \ skipwhite
|
|
26
|
|
27 syn keyword nanorcKeyword contained syntax
|
|
28 \ nextgroup=nanorcSynGroupName skipwhite
|
|
29
|
|
30 syn keyword nanorcKeyword contained color
|
|
31 \ nextgroup=@nanorcFGColor skipwhite
|
|
32
|
|
33 syn keyword nanorcBoolOption contained autoindent backup const cut
|
|
34 \ historylog morespace mouse multibuffer
|
|
35 \ noconvert nofollow nohelp nowrap preserve
|
|
36 \ rebinddelete regexp smarthome smooth suspend
|
|
37 \ tempfile view
|
|
38
|
|
39 syn keyword nanorcStringOption contained backupdir brackets operatingdir
|
|
40 \ punct quotestr speller whitespace
|
|
41 \ nextgroup=nanorcString skipwhite
|
|
42
|
|
43 syn keyword nanorcNumberOption contained fill tabsize
|
|
44 \ nextgroup=nanorcNumber skipwhite
|
|
45
|
|
46 syn region nanorcSynGroupName contained display oneline start=+"+
|
|
47 \ end=+"\ze\%([[:blank:]]\|$\)+
|
|
48 \ nextgroup=nanorcRegexes skipwhite
|
|
49
|
|
50 syn match nanorcString contained display '".*"'
|
|
51
|
|
52 syn region nanorcRegexes contained display oneline start=+"+
|
|
53 \ end=+"\ze\%([[:blank:]]\|$\)+
|
|
54 \ nextgroup=nanorcRegexes skipwhite
|
|
55
|
|
56 syn match nanorcNumber contained display '[+-]\=\<\d\+\>'
|
|
57
|
|
58 syn cluster nanorcFGColor contains=nanorcFGWhite,nanorcFGBlack,
|
|
59 \ nanorcFGRed,nanorcFGBlue,nanorcFGGreen,
|
|
60 \ nanorcFGYellow,nanorcFGMagenta,nanorcFGCyan,
|
|
61 \ nanorcFGBWhite,nanorcFGBBlack,nanorcFGBRed,
|
|
62 \ nanorcFGBBlue,nanorcFGBGreen,nanorcFGBYellow,
|
|
63 \ nanorcFGBMagenta,nanorcFGBCyan
|
|
64
|
|
65 syn keyword nanorcFGWhite contained white
|
|
66 \ nextgroup=@nanorcFGSpec skipwhite
|
|
67
|
|
68 syn keyword nanorcFGBlack contained black
|
|
69 \ nextgroup=@nanorcFGSpec skipwhite
|
|
70
|
|
71 syn keyword nanorcFGRed contained red
|
|
72 \ nextgroup=@nanorcFGSpec skipwhite
|
|
73
|
|
74 syn keyword nanorcFGBlue contained blue
|
|
75 \ nextgroup=@nanorcFGSpec skipwhite
|
|
76
|
|
77 syn keyword nanorcFGGreen contained green
|
|
78 \ nextgroup=@nanorcFGSpec skipwhite
|
|
79
|
|
80 syn keyword nanorcFGYellow contained yellow
|
|
81 \ nextgroup=@nanorcFGSpec skipwhite
|
|
82
|
|
83 syn keyword nanorcFGMagenta contained magenta
|
|
84 \ nextgroup=@nanorcFGSpec skipwhite
|
|
85
|
|
86 syn keyword nanorcFGCyan contained cyan
|
|
87 \ nextgroup=@nanorcFGSpec skipwhite
|
|
88
|
|
89 syn keyword nanorcFGBWhite contained brightwhite
|
|
90 \ nextgroup=@nanorcFGSpec skipwhite
|
|
91
|
|
92 syn keyword nanorcFGBBlack contained brightblack
|
|
93 \ nextgroup=@nanorcFGSpec skipwhite
|
|
94
|
|
95 syn keyword nanorcFGBRed contained brightred
|
|
96 \ nextgroup=@nanorcFGSpec skipwhite
|
|
97
|
|
98 syn keyword nanorcFGBBlue contained brightblue
|
|
99 \ nextgroup=@nanorcFGSpec skipwhite
|
|
100
|
|
101 syn keyword nanorcFGBGreen contained brightgreen
|
|
102 \ nextgroup=@nanorcFGSpec skipwhite
|
|
103
|
|
104 syn keyword nanorcFGBYellow contained brightyellow
|
|
105 \ nextgroup=@nanorcFGSpec skipwhite
|
|
106
|
|
107 syn keyword nanorcFGBMagenta contained brightmagenta
|
|
108 \ nextgroup=@nanorcFGSpec skipwhite
|
|
109
|
|
110 syn keyword nanorcFGBCyan contained brightcyan
|
|
111 \ nextgroup=@nanorcFGSpec skipwhite
|
|
112
|
|
113 syn cluster nanorcBGColor contains=nanorcBGWhite,nanorcBGBlack,
|
|
114 \ nanorcBGRed,nanorcBGBlue,nanorcBGGreen,
|
|
115 \ nanorcBGYellow,nanorcBGMagenta,nanorcBGCyan,
|
|
116 \ nanorcBGBWhite,nanorcBGBBlack,nanorcBGBRed,
|
|
117 \ nanorcBGBBlue,nanorcBGBGreen,nanorcBGBYellow,
|
|
118 \ nanorcBGBMagenta,nanorcBGBCyan
|
|
119
|
|
120 syn keyword nanorcBGWhite contained white
|
|
121 \ nextgroup=@nanorcBGSpec skipwhite
|
|
122
|
|
123 syn keyword nanorcBGBlack contained black
|
|
124 \ nextgroup=@nanorcBGSpec skipwhite
|
|
125
|
|
126 syn keyword nanorcBGRed contained red
|
|
127 \ nextgroup=@nanorcBGSpec skipwhite
|
|
128
|
|
129 syn keyword nanorcBGBlue contained blue
|
|
130 \ nextgroup=@nanorcBGSpec skipwhite
|
|
131
|
|
132 syn keyword nanorcBGGreen contained green
|
|
133 \ nextgroup=@nanorcBGSpec skipwhite
|
|
134
|
|
135 syn keyword nanorcBGYellow contained yellow
|
|
136 \ nextgroup=@nanorcBGSpec skipwhite
|
|
137
|
|
138 syn keyword nanorcBGMagenta contained magenta
|
|
139 \ nextgroup=@nanorcBGSpec skipwhite
|
|
140
|
|
141 syn keyword nanorcBGCyan contained cyan
|
|
142 \ nextgroup=@nanorcBGSpec skipwhite
|
|
143
|
|
144 syn keyword nanorcBGBWhite contained brightwhite
|
|
145 \ nextgroup=@nanorcBGSpec skipwhite
|
|
146
|
|
147 syn keyword nanorcBGBBlack contained brightblack
|
|
148 \ nextgroup=@nanorcBGSpec skipwhite
|
|
149
|
|
150 syn keyword nanorcBGBRed contained brightred
|
|
151 \ nextgroup=@nanorcBGSpec skipwhite
|
|
152
|
|
153 syn keyword nanorcBGBBlue contained brightblue
|
|
154 \ nextgroup=@nanorcBGSpec skipwhite
|
|
155
|
|
156 syn keyword nanorcBGBGreen contained brightgreen
|
|
157 \ nextgroup=@nanorcBGSpec skipwhite
|
|
158
|
|
159 syn keyword nanorcBGBYellow contained brightyellow
|
|
160 \ nextgroup=@nanorcBGSpec skipwhite
|
|
161
|
|
162 syn keyword nanorcBGBMagenta contained brightmagenta
|
|
163 \ nextgroup=@nanorcBGSpec skipwhite
|
|
164
|
|
165 syn keyword nanorcBGBCyan contained brightcyan
|
|
166 \ nextgroup=@nanorcBGSpec skipwhite
|
|
167
|
|
168 syn match nanorcBGColorSep contained ',' nextgroup=@nanorcBGColor
|
|
169
|
|
170 syn cluster nanorcFGSpec contains=nanorcBGColorSep,nanorcRegexes,
|
|
171 \ nanorcStartRegion
|
|
172
|
|
173 syn cluster nanorcBGSpec contains=nanorcRegexes,nanorcStartRegion
|
|
174
|
|
175 syn keyword nanorcStartRegion contained start nextgroup=nanorcStartRegionEq
|
|
176
|
|
177 syn match nanorcStartRegionEq contained '=' nextgroup=nanorcRegion
|
|
178
|
|
179 syn region nanorcRegion contained display oneline start=+"+
|
|
180 \ end=+"\ze\%([[:blank:]]\|$\)+
|
|
181 \ nextgroup=nanorcEndRegion skipwhite
|
|
182
|
|
183 syn keyword nanorcEndRegion contained end nextgroup=nanorcStartRegionEq
|
|
184
|
|
185 syn match nanorcEndRegionEq contained '=' nextgroup=nanorcRegex
|
|
186
|
|
187 syn region nanorcRegex contained display oneline start=+"+
|
|
188 \ end=+"\ze\%([[:blank:]]\|$\)+
|
|
189
|
|
190 hi def link nanorcTodo Todo
|
|
191 hi def link nanorcComment Comment
|
|
192 hi def link nanorcKeyword Keyword
|
|
193 hi def link nanorcBoolOption Identifier
|
|
194 hi def link nanorcStringOption Identifier
|
|
195 hi def link nanorcNumberOption Identifier
|
|
196 hi def link nanorcSynGroupName String
|
|
197 hi def link nanorcString String
|
|
198 hi def link nanorcRegexes nanorcString
|
|
199 hi def link nanorcNumber Number
|
|
200 hi def nanorcFGWhite ctermfg=Gray guifg=Gray
|
|
201 hi def nanorcFGBlack ctermfg=Black guifg=Black
|
|
202 hi def nanorcFGRed ctermfg=DarkRed guifg=DarkRed
|
|
203 hi def nanorcFGBlue ctermfg=DarkBlue guifg=DarkBlue
|
|
204 hi def nanorcFGGreen ctermfg=DarkGreen guifg=DarkGreen
|
|
205 hi def nanorcFGYellow ctermfg=Brown guifg=Brown
|
|
206 hi def nanorcFGMagenta ctermfg=DarkMagenta guifg=DarkMagenta
|
|
207 hi def nanorcFGCyan ctermfg=DarkCyan guifg=DarkCyan
|
|
208 hi def nanorcFGBWhite ctermfg=White guifg=White
|
|
209 hi def nanorcFGBBlack ctermfg=DarkGray guifg=DarkGray
|
|
210 hi def nanorcFGBRed ctermfg=Red guifg=Red
|
|
211 hi def nanorcFGBBlue ctermfg=Blue guifg=Blue
|
|
212 hi def nanorcFGBGreen ctermfg=Green guifg=Green
|
|
213 hi def nanorcFGBYellow ctermfg=Yellow guifg=Yellow
|
|
214 hi def nanorcFGBMagenta ctermfg=Magenta guifg=Magenta
|
|
215 hi def nanorcFGBCyan ctermfg=Cyan guifg=Cyan
|
|
216 hi def link nanorcBGColorSep Normal
|
|
217 hi def nanorcBGWhite ctermbg=Gray guibg=Gray
|
|
218 hi def nanorcBGBlack ctermbg=Black guibg=Black
|
|
219 hi def nanorcBGRed ctermbg=DarkRed guibg=DarkRed
|
|
220 hi def nanorcBGBlue ctermbg=DarkBlue guibg=DarkBlue
|
|
221 hi def nanorcBGGreen ctermbg=DarkGreen guibg=DarkGreen
|
|
222 hi def nanorcBGYellow ctermbg=Brown guibg=Brown
|
|
223 hi def nanorcBGMagenta ctermbg=DarkMagenta guibg=DarkMagenta
|
|
224 hi def nanorcBGCyan ctermbg=DarkCyan guibg=DarkCyan
|
|
225 hi def nanorcBGBWhite ctermbg=White guibg=White
|
|
226 hi def nanorcBGBBlack ctermbg=DarkGray guibg=DarkGray
|
|
227 hi def nanorcBGBRed ctermbg=Red guibg=Red
|
|
228 hi def nanorcBGBBlue ctermbg=Blue guibg=Blue
|
|
229 hi def nanorcBGBGreen ctermbg=Green guibg=Green
|
|
230 hi def nanorcBGBYellow ctermbg=Yellow guibg=Yellow
|
|
231 hi def nanorcBGBMagenta ctermbg=Magenta guibg=Magenta
|
|
232 hi def nanorcBGBCyan ctermbg=Cyan guibg=Cyan
|
|
233 hi def link nanorcStartRegion Type
|
|
234 hi def link nanorcStartRegionEq Operator
|
|
235 hi def link nanorcRegion nanorcString
|
|
236 hi def link nanorcEndRegion Type
|
|
237 hi def link nanorcEndRegionEq Operator
|
|
238 hi def link nanorcRegex nanoRegexes
|
|
239
|
|
240 let b:current_syntax = "nanorc"
|
|
241
|
|
242 let &cpo = s:cpo_save
|
|
243 unlet s:cpo_save
|