2 " Language: nanorc(5) - GNU nano configuration file
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
4 " Latest Revision: 2006-04-19
6 if exists("b:current_syntax")
13 syn keyword nanorcTodo contained TODO FIXME XXX NOTE
15 syn region nanorcComment display oneline start='^\s*#' end='$'
16 \ contains=nanorcTodo,@Spell
18 syn match nanorcBegin display '^'
19 \ nextgroup=nanorcKeyword,nanorcComment
22 syn keyword nanorcKeyword contained set unset
23 \ nextgroup=nanorcBoolOption,
24 \ nanorcStringOption,nanorcNumberOption
27 syn keyword nanorcKeyword contained syntax
28 \ nextgroup=nanorcSynGroupName skipwhite
30 syn keyword nanorcKeyword contained color
31 \ nextgroup=@nanorcFGColor skipwhite
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
39 syn keyword nanorcStringOption contained backupdir brackets operatingdir
40 \ punct quotestr speller whitespace
41 \ nextgroup=nanorcString skipwhite
43 syn keyword nanorcNumberOption contained fill tabsize
44 \ nextgroup=nanorcNumber skipwhite
46 syn region nanorcSynGroupName contained display oneline start=+"+
47 \ end=+"\ze\%([[:blank:]]\|$\)+
48 \ nextgroup=nanorcRegexes skipwhite
50 syn match nanorcString contained display '".*"'
52 syn region nanorcRegexes contained display oneline start=+"+
53 \ end=+"\ze\%([[:blank:]]\|$\)+
54 \ nextgroup=nanorcRegexes skipwhite
56 syn match nanorcNumber contained display '[+-]\=\<\d\+\>'
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
65 syn keyword nanorcFGWhite contained white
66 \ nextgroup=@nanorcFGSpec skipwhite
68 syn keyword nanorcFGBlack contained black
69 \ nextgroup=@nanorcFGSpec skipwhite
71 syn keyword nanorcFGRed contained red
72 \ nextgroup=@nanorcFGSpec skipwhite
74 syn keyword nanorcFGBlue contained blue
75 \ nextgroup=@nanorcFGSpec skipwhite
77 syn keyword nanorcFGGreen contained green
78 \ nextgroup=@nanorcFGSpec skipwhite
80 syn keyword nanorcFGYellow contained yellow
81 \ nextgroup=@nanorcFGSpec skipwhite
83 syn keyword nanorcFGMagenta contained magenta
84 \ nextgroup=@nanorcFGSpec skipwhite
86 syn keyword nanorcFGCyan contained cyan
87 \ nextgroup=@nanorcFGSpec skipwhite
89 syn keyword nanorcFGBWhite contained brightwhite
90 \ nextgroup=@nanorcFGSpec skipwhite
92 syn keyword nanorcFGBBlack contained brightblack
93 \ nextgroup=@nanorcFGSpec skipwhite
95 syn keyword nanorcFGBRed contained brightred
96 \ nextgroup=@nanorcFGSpec skipwhite
98 syn keyword nanorcFGBBlue contained brightblue
99 \ nextgroup=@nanorcFGSpec skipwhite
101 syn keyword nanorcFGBGreen contained brightgreen
102 \ nextgroup=@nanorcFGSpec skipwhite
104 syn keyword nanorcFGBYellow contained brightyellow
105 \ nextgroup=@nanorcFGSpec skipwhite
107 syn keyword nanorcFGBMagenta contained brightmagenta
108 \ nextgroup=@nanorcFGSpec skipwhite
110 syn keyword nanorcFGBCyan contained brightcyan
111 \ nextgroup=@nanorcFGSpec skipwhite
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
120 syn keyword nanorcBGWhite contained white
121 \ nextgroup=@nanorcBGSpec skipwhite
123 syn keyword nanorcBGBlack contained black
124 \ nextgroup=@nanorcBGSpec skipwhite
126 syn keyword nanorcBGRed contained red
127 \ nextgroup=@nanorcBGSpec skipwhite
129 syn keyword nanorcBGBlue contained blue
130 \ nextgroup=@nanorcBGSpec skipwhite
132 syn keyword nanorcBGGreen contained green
133 \ nextgroup=@nanorcBGSpec skipwhite
135 syn keyword nanorcBGYellow contained yellow
136 \ nextgroup=@nanorcBGSpec skipwhite
138 syn keyword nanorcBGMagenta contained magenta
139 \ nextgroup=@nanorcBGSpec skipwhite
141 syn keyword nanorcBGCyan contained cyan
142 \ nextgroup=@nanorcBGSpec skipwhite
144 syn keyword nanorcBGBWhite contained brightwhite
145 \ nextgroup=@nanorcBGSpec skipwhite
147 syn keyword nanorcBGBBlack contained brightblack
148 \ nextgroup=@nanorcBGSpec skipwhite
150 syn keyword nanorcBGBRed contained brightred
151 \ nextgroup=@nanorcBGSpec skipwhite
153 syn keyword nanorcBGBBlue contained brightblue
154 \ nextgroup=@nanorcBGSpec skipwhite
156 syn keyword nanorcBGBGreen contained brightgreen
157 \ nextgroup=@nanorcBGSpec skipwhite
159 syn keyword nanorcBGBYellow contained brightyellow
160 \ nextgroup=@nanorcBGSpec skipwhite
162 syn keyword nanorcBGBMagenta contained brightmagenta
163 \ nextgroup=@nanorcBGSpec skipwhite
165 syn keyword nanorcBGBCyan contained brightcyan
166 \ nextgroup=@nanorcBGSpec skipwhite
168 syn match nanorcBGColorSep contained ',' nextgroup=@nanorcBGColor
170 syn cluster nanorcFGSpec contains=nanorcBGColorSep,nanorcRegexes,
173 syn cluster nanorcBGSpec contains=nanorcRegexes,nanorcStartRegion
175 syn keyword nanorcStartRegion contained start nextgroup=nanorcStartRegionEq
177 syn match nanorcStartRegionEq contained '=' nextgroup=nanorcRegion
179 syn region nanorcRegion contained display oneline start=+"+
180 \ end=+"\ze\%([[:blank:]]\|$\)+
181 \ nextgroup=nanorcEndRegion skipwhite
183 syn keyword nanorcEndRegion contained end nextgroup=nanorcStartRegionEq
185 syn match nanorcEndRegionEq contained '=' nextgroup=nanorcRegex
187 syn region nanorcRegex contained display oneline start=+"+
188 \ end=+"\ze\%([[:blank:]]\|$\)+
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
240 let b:current_syntax = "nanorc"
242 let &cpo = s:cpo_save