robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqvim-patch:62d8f3d: runtime: Revert several "mark invalid contact addresses" commits (#37192)ab20681c52

master
70.6 KiB911 linesraw
1" Vim syntax file
2" Language:	NeoMutt setup files
3" Maintainer:	Richard Russon <rich@flatcap.org>
4" Previous Maintainer:	Guillaume Brogi <gui-gui@netcourrier.com>
5" Last Change:	2024 Oct 12
6" Original version based on syntax/muttrc.vim
7
8" This file covers NeoMutt 2024-10-02
9
10" quit when a syntax file was already loaded
11if exists("b:current_syntax")
12  finish
13endif
14
15let s:cpo_save = &cpo
16set cpo&vim
17
18" Set the keyword characters
19setlocal isk=@,48-57,_,-
20
21" handling optional variables
22syntax match muttrcComment	"^# .*$" contains=@Spell
23syntax match muttrcComment	"^#[^ ].*$"
24syntax match muttrcComment	"^#$"
25syntax match muttrcComment	"[^\\]#.*$"lc=1 contains=@Spell
26
27" Escape sequences (back-tick and pipe goes here too)
28syntax match muttrcEscape	+\\[#tnr"'Cc ]+
29syntax match muttrcEscape	+[`|]+
30syntax match muttrcEscape	+\\$+
31
32" The variables takes the following arguments
33syntax region muttrcString	contained keepend start=+"+ms=e skip=+\\"+ end=+"+ contains=muttrcEscape,muttrcCommand,muttrcAction,muttrcShellString
34syntax region muttrcString	contained keepend start=+'+ms=e skip=+\\'+ end=+'+ contains=muttrcEscape,muttrcCommand,muttrcAction
35syntax match muttrcStringNL	contained skipwhite skipnl "\s*\\$" nextgroup=muttrcString,muttrcStringNL
36
37syntax region muttrcShellString	matchgroup=muttrcEscape keepend start=+`+ skip=+\\`+ end=+`+ contains=muttrcVarString,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcCommand
38
39syntax match  muttrcRXChars	contained /[^\\][][.*?+]\+/hs=s+1
40syntax match  muttrcRXChars	contained /[][|()][.*?+]*/
41syntax match  muttrcRXChars	contained /['"]^/ms=s+1
42syntax match  muttrcRXChars	contained /$['"]/me=e-1
43syntax match  muttrcRXChars	contained /\\/
44" Why does muttrcRXString2 work with one \ when muttrcRXString requires two?
45syntax region muttrcRXString	contained skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXChars
46syntax region muttrcRXString	contained skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcRXChars
47syntax region muttrcRXString	contained skipwhite start=+[^	 "'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXChars
48" For some reason, skip refuses to match backslashes here...
49syntax region muttrcRXString	contained matchgroup=muttrcRXChars skipwhite start=+\^+ end=+[^\\]\s+re=e-1 contains=muttrcRXChars
50syntax region muttrcRXString	contained matchgroup=muttrcRXChars skipwhite start=+\^+ end=+$\s+ contains=muttrcRXChars
51syntax region muttrcRXString2	contained skipwhite start=+'+ skip=+\'+ end=+'+ contains=muttrcRXChars
52syntax region muttrcRXString2	contained skipwhite start=+"+ skip=+\"+ end=+"+ contains=muttrcRXChars
53
54" these must be kept synchronized with muttrcRXString, but are intended for muttrcRXHooks
55syntax region muttrcRXHookString	contained keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL
56syntax region muttrcRXHookString	contained keepend skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL
57syntax region muttrcRXHookString	contained keepend skipwhite start=+[^	 "'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL
58syntax region muttrcRXHookString	contained keepend skipwhite start=+\^+ end=+[^\\]\s+re=e-1 contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL
59syntax region muttrcRXHookString	contained keepend matchgroup=muttrcRXChars skipwhite start=+\^+ end=+$\s+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL
60syntax match muttrcRXHookStringNL	contained skipwhite skipnl "\s*\\$" nextgroup=muttrcRXHookString,muttrcRXHookStringNL
61
62" these are exclusively for args lists (e.g. -rx pat pat pat ...)
63syntax region muttrcRXPat	contained keepend skipwhite start=+'+ skip=+\\'+ end=+'\s*+ contains=muttrcRXString nextgroup=muttrcRXPat
64syntax region muttrcRXPat	contained keepend skipwhite start=+"+ skip=+\\"+ end=+"\s*+ contains=muttrcRXString nextgroup=muttrcRXPat
65syntax match muttrcRXPat	contained /[^-'"#!]\S\+/ skipwhite contains=muttrcRXChars nextgroup=muttrcRXPat
66syntax match muttrcRXDef	contained "-rx\s\+" skipwhite nextgroup=muttrcRXPat
67
68syntax match muttrcSpecial	+\(['"]\)!\1+
69
70syntax match muttrcSetStrAssignment  contained skipwhite /=\s*\%(\\\?\$\)\?[0-9A-Za-z_-]\+/hs=s+1       nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString contains=muttrcVariable,muttrcEscapedVariable
71syntax region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*"+hs=s+1 end=+"+ skip=+\\"+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString contains=muttrcString
72syntax region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*'+hs=s+1 end=+'+ skip=+\\'+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString contains=muttrcString
73syntax match muttrcSetBoolAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1                         nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString contains=muttrcVariable,muttrcEscapedVariable
74syntax match muttrcSetBoolAssignment contained skipwhite /=\s*\%(yes\|no\)/hs=s+1                       nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
75syntax match muttrcSetBoolAssignment contained skipwhite /=\s*"\%(yes\|no\)"/hs=s+1                     nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
76syntax match muttrcSetBoolAssignment contained skipwhite /=\s*'\%(yes\|no\)'/hs=s+1                     nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
77syntax match muttrcSetQuadAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1                         nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString contains=muttrcVariable,muttrcEscapedVariable
78syntax match muttrcSetQuadAssignment contained skipwhite /=\s*\%(ask-\)\?\%(yes\|no\)/hs=s+1            nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
79syntax match muttrcSetQuadAssignment contained skipwhite /=\s*"\%(ask-\)\?\%(yes\|no\)"/hs=s+1          nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
80syntax match muttrcSetQuadAssignment contained skipwhite /=\s*'\%(ask-\)\?\%(yes\|no\)'/hs=s+1          nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
81syntax match muttrcSetNumAssignment  contained skipwhite /=\s*\\\?\$\w\+/hs=s+1                         nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString contains=muttrcVariable,muttrcEscapedVariable
82syntax match muttrcSetNumAssignment  contained skipwhite /=\s*\d\+/hs=s+1                               nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
83syntax match muttrcSetNumAssignment  contained skipwhite /=\s*"\d\+"/hs=s+1                             nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
84syntax match muttrcSetNumAssignment  contained skipwhite /=\s*'\d\+'/hs=s+1                             nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
85
86" Now catch some email addresses and headers (purified version from mail.vim)
87syntax match muttrcEmail	"[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+"
88syntax match muttrcHeader	"\<\c\%(From\|To\|C[Cc]\|B[Cc][Cc]\|Reply-To\|Subject\|Return-Path\|Received\|Date\|Replied\|Attach\)\>:\="
89
90syntax match   muttrcKeySpecial	contained +\%(\\[Cc'"]\|\^\|\\[01]\d\{2}\)+
91syntax match   muttrcKey	contained "\S\+"			contains=muttrcKeySpecial,muttrcKeyName
92syntax region  muttrcKey	contained start=+"+ skip=+\\\\\|\\"+ end=+"+	contains=muttrcKeySpecial,muttrcKeyName
93syntax region  muttrcKey	contained start=+'+ skip=+\\\\\|\\'+ end=+'+	contains=muttrcKeySpecial,muttrcKeyName
94syntax match   muttrcKeyName	contained "\\[trne]"
95syntax match   muttrcKeyName	contained "\c<\%(BackSpace\|BackTab\|Delete\|Down\|End\|Enter\|Esc\|Home\|Insert\|Left\|Next\|PageDown\|PageUp\|Return\|Right\|Space\|Tab\|Up\)>"
96syntax match   muttrcKeyName	contained "\c<F\d\+>"
97
98syntax match muttrcFormatErrors contained /%./
99
100syntax match muttrcStrftimeEscapes contained /%[AaBbCcDdeFGgHhIjklMmnpRrSsTtUuVvWwXxYyZz+%]/
101syntax match muttrcStrftimeEscapes contained /%E[cCxXyY]/
102syntax match muttrcStrftimeEscapes contained /%O[BdeHImMSuUVwWy]/
103
104" Defines syntax matches for muttrc[baseName]Escapes, muttrc[baseName]Conditionals
105" If padding==1, also match `%>` `%|` `%*` expandos
106" If conditional==1, some expandos support %X? format
107syntax match muttrcFormatConditionals2 contained /[^?]*?/
108function! s:escapesConditionals(baseName, sequence, padding, conditional)
109	exec 'syntax match muttrc' . a:baseName . 'Escapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?\%(' . a:sequence . '\|%\)/'
110	if a:padding
111		exec 'syntax match muttrc' . a:baseName . 'Escapes contained /%[>|*]./'
112	endif
113	if a:conditional
114		exec 'syntax match muttrc' . a:baseName . 'Conditionals contained /%?\%(' . a:sequence . '\)?/ nextgroup=muttrcFormatConditionals2'
115	else
116		exec 'syntax match muttrc' . a:baseName . 'Conditionals contained /%?\%(' . a:sequence . '\)?/'
117	endif
118endfunction
119
120" CHECKED 2024 Oct 12
121" Ref: AliasFormatDef in alias/config.c
122call s:escapesConditionals('AliasFormat', '[acfnrtY]', 1, 0)
123" Ref: AttachFormatDef in mutt_config.c
124call s:escapesConditionals('AttachFormat', '[CcDdeFfIMmnQsTtuX]', 1, 1)
125" Ref: AutocryptFormatDef in autocrypt/config.c
126call s:escapesConditionals('AutocryptFormat', '[aknps]', 1, 0)
127" Ref: ComposeFormatDef in compose/config.c
128call s:escapesConditionals('ComposeFormat', '[ahlv]', 1, 1)
129" Ref: FolderFormatDef in browser/config.c
130call s:escapesConditionals('FolderFormat', '[aCDdFfgilmNnpstu[]', 1, 1)
131" Ref: GreetingFormatDef in send/config.c
132call s:escapesConditionals('GreetingFormat', '[nuv]', 0, 0)
133" Ref: GroupIndexFormatDef in browser/config.c
134call s:escapesConditionals('GroupIndexFormat', '[aCdfMNnps]', 1, 0)
135" Ref: HistoryFormatDef in history/config.c
136call s:escapesConditionals('HistoryFormat', '[Cs]', 1, 0)
137" Ref: IndexFormatDef in mutt_config.c
138call s:escapesConditionals('IndexFormat', '[AaBbCDdEefgHIiJKLlMmNnOPqRrSsTtuvWXxYyZ(<[{]\|@\i\+@\|G[a-zA-Z]\+\|Fp\=\|z[cst]\|cr\=', 1, 1)
139" Ref: PatternFormatDef in pattern/config.c
140call s:escapesConditionals('PatternFormat', '[den]', 1, 0)
141" Ref: PgpCommandFormatDef in ncrypt/config.c
142call s:escapesConditionals('PgpCommandFormat', '[afprs]', 0, 1)
143" Ref: PgpEntryFormatDef in ncrypt/config.c
144call s:escapesConditionals('PgpEntryFormat', '[AaCcFfIiKkLlnptu[]', 1, 1)
145" Ref: QueryFormatDef in alias/config.c
146call s:escapesConditionals('QueryFormat', '[acentY]', 1, 1)
147" Ref: SidebarFormatDef in sidebar/config.c
148call s:escapesConditionals('SidebarFormat', '[!aBDdFLNnoprStZ]', 1, 1)
149" Ref: SmimeCommandFormatDef in ncrypt/config.c
150call s:escapesConditionals('SmimeCommandFormat', '[aCcdfiks]', 0, 1)
151" Ref: StatusFormatDef in mutt_config.c
152call s:escapesConditionals('StatusFormat', '[bDdFfhLlMmnoPpRrSsTtuVv]', 1, 1)
153
154syntax region muttrcAliasFormatString         contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAliasFormatEscapes,muttrcAliasFormatConditionals,muttrcFormatErrors                                   nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
155syntax region muttrcAliasFormatString         contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAliasFormatEscapes,muttrcAliasFormatConditionals,muttrcFormatErrors                                   nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
156syntax region muttrcAttachFormatString        contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors                                 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
157syntax region muttrcAttachFormatString        contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors                                 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
158syntax region muttrcAutocryptFormatString     contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAutocryptFormatEscapes,muttrcAutocryptFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
159syntax region muttrcAutocryptFormatString     contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAutocryptFormatEscapes,muttrcAutocryptFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
160syntax region muttrcComposeFormatString       contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcComposeFormatEscapes,muttrcComposeFormatConditionals,muttrcFormatErrors                               nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
161syntax region muttrcComposeFormatString       contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcComposeFormatEscapes,muttrcComposeFormatConditionals,muttrcFormatErrors                               nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
162syntax region muttrcFolderFormatString        contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors                                 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
163syntax region muttrcFolderFormatString        contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors                                 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
164syntax region muttrcGreetingFormatString      contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcGreetingFormatEscapes,muttrcGreetingFormatConditionals,muttrcFormatErrors                             nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
165syntax region muttrcGreetingFormatString      contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcGreetingFormatEscapes,muttrcGreetingFormatConditionals,muttrcFormatErrors                             nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
166syntax region muttrcGroupIndexFormatString    contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcGroupIndexFormatEscapes,muttrcGroupIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes       nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
167syntax region muttrcGroupIndexFormatString    contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcGroupIndexFormatEscapes,muttrcGroupIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes       nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
168syntax region muttrcHistoryFormatString       contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcHistoryFormatEscapes,muttrcHistoryFormatConditionals,muttrcFormatErrors                               nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
169syntax region muttrcHistoryFormatString       contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcHistoryFormatEscapes,muttrcHistoryFormatConditionals,muttrcFormatErrors                               nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
170syntax region muttrcIndexFormatString         contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes                 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
171syntax region muttrcIndexFormatString         contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes                 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
172syntax region muttrcPatternFormatString       contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPatternFormatEscapes,muttrcPatternFormatConditionals,muttrcFormatErrors                               nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
173syntax region muttrcPatternFormatString       contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPatternFormatEscapes,muttrcPatternFormatConditionals,muttrcFormatErrors                               nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
174syntax region muttrcPgpCommandFormatString    contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPgpCommandFormatEscapes,muttrcPgpCommandFormatConditionals,muttrcVariable,muttrcFormatErrors          nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
175syntax region muttrcPgpCommandFormatString    contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPgpCommandFormatEscapes,muttrcPgpCommandFormatConditionals,muttrcVariable,muttrcFormatErrors          nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
176syntax region muttrcPgpEntryFormatString      contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPgpEntryFormatEscapes,muttrcPgpEntryFormatConditionals,muttrcFormatErrors,muttrcPgpTimeEscapes        nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
177syntax region muttrcPgpEntryFormatString      contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPgpEntryFormatEscapes,muttrcPgpEntryFormatConditionals,muttrcFormatErrors,muttrcPgpTimeEscapes        nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
178syntax region muttrcQueryFormatString         contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcQueryFormatEscapes,muttrcQueryFormatConditionals,muttrcFormatErrors                                   nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
179syntax region muttrcQueryFormatString         contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcQueryFormatEscapes,muttrcQueryFormatConditionals,muttrcFormatErrors                                   nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
180syntax region muttrcSidebarFormatString       contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcSidebarFormatEscapes,muttrcSidebarFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes             nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
181syntax region muttrcSidebarFormatString       contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcSidebarFormatEscapes,muttrcSidebarFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes             nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
182syntax region muttrcSmimeCommandFormatString  contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcSmimeCommandFormatEscapes,muttrcSmimeCommandFormatConditionals,muttrcVariable,muttrcFormatErrors      nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
183syntax region muttrcSmimeCommandFormatString  contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcSmimeCommandFormatEscapes,muttrcSmimeCommandFormatConditionals,muttrcVariable,muttrcFormatErrors      nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
184syntax region muttrcStatusFormatString        contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors                                 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
185syntax region muttrcStatusFormatString        contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors                                 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
186syntax region muttrcStrftimeFormatString      contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStrftimeEscapes,muttrcFormatErrors                                                                    nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
187syntax region muttrcStrftimeFormatString      contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStrftimeEscapes,muttrcFormatErrors                                                                    nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
188
189" Format escapes and conditionals
190syntax match muttrcFormatConditionals2 contained /[^?]*?/
191
192syntax region muttrcPgpTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes
193syntax region muttrcTimeEscapes    contained start=+%(+  end=+)+  contains=muttrcStrftimeEscapes
194syntax region muttrcTimeEscapes    contained start=+%<+  end=+>+  contains=muttrcStrftimeEscapes
195syntax region muttrcTimeEscapes    contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes
196syntax region muttrcTimeEscapes    contained start=+%{+  end=+}+  contains=muttrcStrftimeEscapes
197
198syntax match muttrcVarEqualsAliasFormat         contained skipwhite "=" nextgroup=muttrcAliasFormatString
199syntax match muttrcVarEqualsAttachFormat        contained skipwhite "=" nextgroup=muttrcAttachFormatString
200syntax match muttrcVarEqualsAutocryptFormat     contained skipwhite "=" nextgroup=muttrcAutocryptFormatString
201syntax match muttrcVarEqualsComposeFormat       contained skipwhite "=" nextgroup=muttrcComposeFormatString
202syntax match muttrcVarEqualsFolderFormat        contained skipwhite "=" nextgroup=muttrcFolderFormatString
203syntax match muttrcVarEqualsGreetingFormat      contained skipwhite "=" nextgroup=muttrcGreetingFormatString
204syntax match muttrcVarEqualsGroupIndexFormat    contained skipwhite "=" nextgroup=muttrcGroupIndexFormatString
205syntax match muttrcVarEqualsHistoryFormat       contained skipwhite "=" nextgroup=muttrcHistoryFormatString
206syntax match muttrcVarEqualsIndexFormat         contained skipwhite "=" nextgroup=muttrcIndexFormatString
207syntax match muttrcVarEqualsPatternFormat       contained skipwhite "=" nextgroup=muttrcPatternFormatString
208syntax match muttrcVarEqualsPgpCommandFormat    contained skipwhite "=" nextgroup=muttrcPgpCommandFormatString
209syntax match muttrcVarEqualsPgpEntryFormat      contained skipwhite "=" nextgroup=muttrcPgpEntryFormatString
210syntax match muttrcVarEqualsQueryFormat         contained skipwhite "=" nextgroup=muttrcQueryFormatString
211syntax match muttrcVarEqualsSidebarFormat       contained skipwhite "=" nextgroup=muttrcSidebarFormatString
212syntax match muttrcVarEqualsSmimeCommandFormat  contained skipwhite "=" nextgroup=muttrcSmimeCommandFormatString
213syntax match muttrcVarEqualsStatusFormat        contained skipwhite "=" nextgroup=muttrcStatusFormatString
214syntax match muttrcVarEqualsStrftimeFormat      contained skipwhite "=" nextgroup=muttrcStrftimeFormatString
215
216syntax match muttrcVPrefix contained /[?&]/ nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
217
218" CHECKED 2024 Oct 12
219" List of the different screens in NeoMutt (see MenuNames in menu/type.c)
220syntax keyword muttrcMenu contained alias attach autocrypt browser compose dialog editor generic index key_select_pgp key_select_smime pager pgp postpone query smime
221syntax match muttrcMenuList "\S\+" contained contains=muttrcMenu
222syntax match muttrcMenuCommas /,/ contained
223
224syntax region muttrcSpamPattern	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPattern nextgroup=muttrcString,muttrcStringNL
225syntax region muttrcSpamPattern	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPattern nextgroup=muttrcString,muttrcStringNL
226
227syntax region muttrcNoSpamPattern	contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPattern
228syntax region muttrcNoSpamPattern	contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPattern
229
230syntax match muttrcAttachmentsMimeType contained "[*a-z0-9_-]\+/[*a-z0-9._-]\+\s*" skipwhite nextgroup=muttrcAttachmentsMimeType
231syntax match muttrcAttachmentsFlag contained "[+-]\%([AI]\|inline\|attachment\)\s\+" skipwhite nextgroup=muttrcAttachmentsMimeType
232syntax match muttrcAttachmentsLine "^\s*\%(un\)\?attachments\s\+" skipwhite nextgroup=muttrcAttachmentsFlag
233
234syntax match muttrcUnHighlightSpace contained "\%(\s\+\|\\$\)"
235
236syntax keyword muttrcAsterisk	contained *
237
238syntax keyword muttrcListsKeyword	lists skipwhite nextgroup=muttrcGroupDef,muttrcComment
239syntax keyword muttrcListsKeyword	unlists skipwhite nextgroup=muttrcAsterisk,muttrcComment
240
241syntax keyword muttrcSubscribeKeyword	subscribe skipwhite nextgroup=muttrcGroupDef,muttrcComment
242syntax keyword muttrcSubscribeKeyword	unsubscribe skipwhite nextgroup=muttrcAsterisk,muttrcComment
243
244syntax keyword muttrcAlternateKeyword contained alternates unalternates
245syntax region muttrcAlternatesLine keepend start=+^\s*\%(un\)\?alternates\s+ skip=+\\$+ end=+$+ contains=muttrcAlternateKeyword,muttrcGroupDef,muttrcRXPat,muttrcUnHighlightSpace,muttrcComment
246
247" muttrcVariable includes a prefix because partial strings are considered valid.
248syntax match muttrcVariable	contained "\\\@<![a-zA-Z_-]*\$[a-zA-Z_-]\+" contains=muttrcVariableInner
249syntax match muttrcVariableInner	contained "\$[a-zA-Z_-]\+"
250syntax match muttrcEscapedVariable	contained "\\\$[a-zA-Z_-]\+"
251
252syntax match muttrcBadAction	contained "[^<>]\+" contains=muttrcEmail
253syntax match muttrcAction		contained "<[^>]\{-}>" contains=muttrcBadAction,muttrcFunction,muttrcKeyName
254
255" CHECKED 2024 Oct 12
256" First, hooks that take regular expressions:
257syntax match  muttrcRXHookNot		contained /!\s*/ skipwhite nextgroup=muttrcRXHookString,muttrcRXHookStringNL
258syntax match  muttrcRXHookNoRegex	contained /-noregex/ skipwhite nextgroup=muttrcRXHookString,muttrcRXHookStringNL
259syntax match  muttrcRXHooks	/\<\%(account\|append\|close\|crypt\|open\|pgp\|shutdown\|startup\|timeout\)-hook\>/ skipwhite nextgroup=muttrcRXHookNot,muttrcRXHookString,muttrcRXHookStringNL
260syntax match  muttrcRXHooks	/\<\%(folder\|mbox\)-hook\>/ skipwhite nextgroup=muttrcRXHookNoRegex,muttrcRXHookNot,muttrcRXHookString,muttrcRXHookStringNL
261
262" Now, hooks that take patterns
263syntax match muttrcPatHookNot	contained /!\s*/ skipwhite nextgroup=muttrcPattern
264syntax match muttrcPatHooks	/\<\%(charset\|iconv\|index-format\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcPattern
265syntax match muttrcPatHooks	/\<\%(message\|reply\|send\|send2\|save\|fcc\|fcc-save\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcOptPattern
266
267" Global hooks that take a command
268syntax keyword muttrcHooks skipwhite shutdown-hook startup-hook timeout-hook nextgroup=muttrcCommand
269
270syntax match muttrcBindFunction		contained /\S\+\>/ skipwhite contains=muttrcFunction
271syntax match muttrcBindFunctionNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindFunction,muttrcBindFunctionNL
272syntax match muttrcBindKey		contained /\S\+/   skipwhite contains=muttrcKey nextgroup=muttrcBindFunction,muttrcBindFunctionNL
273syntax match muttrcBindKeyNL		contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindKey,muttrcBindKeyNL
274syntax match muttrcBindMenuList		contained /\S\+/   skipwhite contains=muttrcMenu,muttrcMenuCommas nextgroup=muttrcBindKey,muttrcBindKeyNL
275syntax match muttrcBindMenuListNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindMenuList,muttrcBindMenuListNL
276
277syntax region muttrcMacroDescr	contained keepend skipwhite start=+\s*\S+ms=e skip=+\\ + end=+ \|$+me=s
278syntax region muttrcMacroDescr	contained keepend skipwhite start=+'+ms=e skip=+\\'+ end=+'+me=s
279syntax region muttrcMacroDescr	contained keepend skipwhite start=+"+ms=e skip=+\\"+ end=+"+me=s
280syntax match muttrcMacroDescrNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroDescr,muttrcMacroDescrNL
281syntax region muttrcMacroBody	contained skipwhite start="\S" skip='\\ \|\\$' end=' \|$' contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL
282syntax region muttrcMacroBody	matchgroup=Type contained skipwhite start=+'+ms=e skip=+\\'+ end=+'\|\%(\%(\\\\\)\@<!$\)+me=s contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcSpam,muttrcNoSpam,muttrcCommand,muttrcAction,muttrcVariable nextgroup=muttrcMacroDescr,muttrcMacroDescrNL
283syntax region muttrcMacroBody	matchgroup=Type contained skipwhite start=+"+ms=e skip=+\\"+ end=+"\|\%(\%(\\\\\)\@<!$\)+me=s contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcSpam,muttrcNoSpam,muttrcCommand,muttrcAction,muttrcVariable nextgroup=muttrcMacroDescr,muttrcMacroDescrNL
284syntax match muttrcMacroBodyNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroBody,muttrcMacroBodyNL
285syntax match muttrcMacroKey	contained /\S\+/ skipwhite contains=muttrcKey nextgroup=muttrcMacroBody,muttrcMacroBodyNL
286syntax match muttrcMacroKeyNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroKey,muttrcMacroKeyNL
287syntax match muttrcMacroMenuList	contained /\S\+/ skipwhite contains=muttrcMenu,muttrcMenuCommas nextgroup=muttrcMacroKey,muttrcMacroKeyNL
288syntax match muttrcMacroMenuListNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroMenuList,muttrcMacroMenuListNL
289
290syntax match muttrcAddrContent	contained "[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+\s*" skipwhite contains=muttrcEmail nextgroup=muttrcAddrContent
291syntax region muttrcAddrContent	contained start=+'+ end=+'\s*+ skip=+\\'+ skipwhite contains=muttrcEmail nextgroup=muttrcAddrContent
292syntax region muttrcAddrContent	contained start=+"+ end=+"\s*+ skip=+\\"+ skipwhite contains=muttrcEmail nextgroup=muttrcAddrContent
293syntax match muttrcAddrDef	contained "-addr\s\+" skipwhite nextgroup=muttrcAddrContent
294
295syntax match muttrcGroupFlag	contained "-group"
296syntax region muttrcGroupDef	contained start="-group\s\+" skip="\\$" end="\s" skipwhite keepend contains=muttrcGroupFlag,muttrcUnHighlightSpace
297
298syntax keyword muttrcGroupKeyword	contained group ungroup
299syntax region muttrcGroupLine	keepend start=+^\s*\%(un\)\?group\s+ skip=+\\$+ end=+$+ contains=muttrcGroupKeyword,muttrcGroupDef,muttrcAddrDef,muttrcRXDef,muttrcUnHighlightSpace,muttrcComment
300
301syntax match muttrcAliasGroupName	contained /\w\+/ skipwhite nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL
302syntax match muttrcAliasGroupDefNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasGroupName,muttrcAliasGroupDefNL
303syntax match muttrcAliasGroupDef	contained /\s*-group/ skipwhite nextgroup=muttrcAliasGroupName,muttrcAliasGroupDefNL contains=muttrcGroupFlag
304syntax match muttrcAliasComma	contained /,/ skipwhite nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL
305syntax match muttrcAliasEmail	contained /\S\+@\S\+/ contains=muttrcEmail nextgroup=muttrcAliasName,muttrcAliasNameNL skipwhite
306syntax match muttrcAliasEncEmail	contained /<[^>]\+>/ contains=muttrcEmail nextgroup=muttrcAliasComma
307syntax match muttrcAliasEncEmailNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasEncEmail,muttrcAliasEncEmailNL
308syntax match muttrcAliasNameNoParens contained /[^<(@]\+\s\+/ nextgroup=muttrcAliasEncEmail,muttrcAliasEncEmailNL
309syntax region muttrcAliasName	contained matchgroup=Type start=/(/ end=/)/ skipwhite
310syntax match muttrcAliasNameNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasName,muttrcAliasNameNL
311syntax match muttrcAliasENNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL
312syntax match muttrcAliasKey	contained /\s*[^- \t]\S\+/ skipwhite nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL
313syntax match muttrcAliasNL		contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL
314
315syntax match muttrcUnAliasKey	contained "\s*\w\+\s*" skipwhite nextgroup=muttrcUnAliasKey,muttrcUnAliasNL
316syntax match muttrcUnAliasNL	contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcUnAliasKey,muttrcUnAliasNL
317
318" CHECKED 2024 Oct 12
319" List of letters in Flags in pattern/flags.c
320" Parameter: none
321syntax match muttrcSimplePat contained "!\?\^\?[~][ADEFGgklNOPpQRSTUuVv#$=]"
322" Parameter: range
323syntax match muttrcSimplePat contained "!\?\^\?[~][mnXz]\s*\%([<>-][0-9]\+[kM]\?\|[0-9]\+[kM]\?[-]\%([0-9]\+[kM]\?\)\?\)"
324" Parameter: date
325syntax match muttrcSimplePat contained "!\?\^\?[~][dr]\s*\%(\%(-\?[0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)\|\%(\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)-\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)\?\)\?\)\|\%([<>=][0-9]\+[ymwd]\)\|\%(`[^`]\+`\)\|\%(\$[a-zA-Z0-9_-]\+\)\)" contains=muttrcShellString,muttrcVariable
326" Parameter: regex
327syntax match muttrcSimplePat contained "!\?\^\?[~][BbCcefHhIiKLMstwxYy]\s*" nextgroup=muttrcSimplePatRXContainer
328" Parameter: pattern
329syntax match muttrcSimplePat contained "!\?\^\?[%][BbCcefHhiLstxy]\s*" nextgroup=muttrcSimplePatString
330" Parameter: pattern
331syntax match muttrcSimplePat contained "!\?\^\?[=][bcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatString
332syntax region muttrcSimplePat contained keepend start=+!\?\^\?[~](+ end=+)+ contains=muttrcSimplePat
333
334"syn match muttrcSimplePat contained /'[^~=%][^']*/ contains=muttrcRXString
335syntax region muttrcSimplePatString contained keepend start=+"+ end=+"+ skip=+\\"+
336syntax region muttrcSimplePatString contained keepend start=+'+ end=+'+ skip=+\\'+
337syntax region muttrcSimplePatString contained keepend start=+[^	 "']+ skip=+\\ + end=+\s+re=e-1
338syntax region muttrcSimplePatRXContainer contained keepend start=+"+ end=+"+ skip=+\\"+ contains=muttrcRXString
339syntax region muttrcSimplePatRXContainer contained keepend start=+'+ end=+'+ skip=+\\'+ contains=muttrcRXString
340syntax region muttrcSimplePatRXContainer contained keepend start=+[^	 "']+ skip=+\\ + end=+\s+re=e-1 contains=muttrcRXString
341syntax match muttrcSimplePatMetas contained /[(|)]/
342
343syntax match muttrcOptSimplePat contained skipwhite /[~=%!(^].*/ contains=muttrcSimplePat,muttrcSimplePatMetas
344syntax match muttrcOptSimplePat contained skipwhite /[^~=%!(^].*/ contains=muttrcRXString
345syntax region muttrcOptPattern contained matchgroup=Type keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcOptSimplePat,muttrcUnHighlightSpace nextgroup=muttrcString,muttrcStringNL
346syntax region muttrcOptPattern contained matchgroup=Type keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcOptSimplePat,muttrcUnHighlightSpace nextgroup=muttrcString,muttrcStringNL
347syntax region muttrcOptPattern contained keepend skipwhite start=+[~](+ end=+)+ skip=+\\)+ contains=muttrcSimplePat nextgroup=muttrcString,muttrcStringNL
348syntax match muttrcOptPattern contained skipwhite /[~][A-Za-z]/ contains=muttrcSimplePat nextgroup=muttrcString,muttrcStringNL
349syntax match muttrcOptPattern contained skipwhite /[.]/ nextgroup=muttrcString,muttrcStringNL
350" Keep muttrcPattern and muttrcOptPattern synchronized
351syntax region muttrcPattern contained matchgroup=Type keepend skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas
352syntax region muttrcPattern contained matchgroup=Type keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas
353syntax region muttrcPattern contained keepend skipwhite start=+[~](+ end=+)+ skip=+\\)+ contains=muttrcSimplePat
354syntax match muttrcPattern contained skipwhite /[~][A-Za-z]/ contains=muttrcSimplePat
355syntax match muttrcPattern contained skipwhite /[.]/
356syntax region muttrcPatternInner contained keepend start=+"[~=%!(^]+ms=s+1 skip=+\\"+ end=+"+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas
357syntax region muttrcPatternInner contained keepend start=+'[~=%!(^]+ms=s+1 skip=+\\'+ end=+'+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas
358
359" Colour definitions takes object, foreground and background arguments (regexes excluded).
360syntax match muttrcColorMatchCount	contained "[0-9]\+"
361syntax match muttrcColorMatchCountNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL
362syntax region muttrcColorRXPat	contained start=+\s*'+ skip=+\\'+ end=+'\s*+ keepend skipwhite contains=muttrcRXString2 nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL
363syntax region muttrcColorRXPat	contained start=+\s*"+ skip=+\\"+ end=+"\s*+ keepend skipwhite contains=muttrcRXString2 nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL
364syntax keyword muttrcColor	contained black blue cyan default green magenta red white yellow
365syntax keyword muttrcColor	contained brightblack brightblue brightcyan brightdefault brightgreen brightmagenta brightred brightwhite brightyellow
366syntax keyword muttrcColor	contained lightblack lightblue lightcyan lightdefault lightgreen lightmagenta lightred lightwhite lightyellow
367syntax keyword muttrcColor	contained alertblack alertblue alertcyan alertdefault alertgreen alertmagenta alertred alertwhite alertyellow
368syntax match   muttrcColor	contained "\<\%(bright\)\=color\d\{1,3}\>"
369syntax match   muttrcColor	contained "#[0-9a-fA-F]\{6}\>"
370
371" Now for the structure of the color line
372syntax match muttrcColorRXNL	contained skipnl "\s*\\$" nextgroup=muttrcColorRXPat,muttrcColorRXNL
373syntax match muttrcColorBG	contained /\s*[#$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorRXPat,muttrcColorRXNL
374syntax match muttrcColorBGNL	contained skipnl "\s*\\$" nextgroup=muttrcColorBG,muttrcColorBGNL
375syntax match muttrcColorFG	contained /\s*[#$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBG,muttrcColorBGNL
376syntax match muttrcColorFGNL	contained skipnl "\s*\\$" nextgroup=muttrcColorFG,muttrcColorFGNL
377syntax match muttrcColorContext	contained /\s*[#$]\?\w\+/ contains=muttrcColorField,muttrcVariable,muttrcUnHighlightSpace,muttrcColorCompose nextgroup=muttrcColorFG,muttrcColorFGNL
378syntax match muttrcColorNL	contained skipnl "\s*\\$" nextgroup=muttrcColorContext,muttrcColorNL,muttrcColorCompose
379syntax match muttrcColorKeyword	contained /^\s*color\s\+/ nextgroup=muttrcColorContext,muttrcColorNL,muttrcColorCompose
380" And now color's brother:
381syntax region muttrcUnColorPatterns contained skipwhite start=+\s*'+ end=+'+ skip=+\\'+ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL
382syntax region muttrcUnColorPatterns contained skipwhite start=+\s*"+ end=+"+ skip=+\\"+ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL
383syntax match muttrcUnColorPatterns contained skipwhite /\s*[^'"\s]\S\*/ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL
384syntax match muttrcUnColorPatNL	contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL
385syntax match muttrcUnColorAll	contained skipwhite /[*]/
386syntax match muttrcUnColorAPNL	contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorPatterns,muttrcUnColorAll,muttrcUnColorAPNL
387syntax match muttrcUnColorIndex	contained skipwhite /\s*index\s\+/ nextgroup=muttrcUnColorPatterns,muttrcUnColorAll,muttrcUnColorAPNL
388syntax match muttrcUnColorIndexNL	contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorIndex,muttrcUnColorIndexNL
389syntax match muttrcUnColorKeyword	contained skipwhite /^\s*uncolor\s\+/ nextgroup=muttrcUnColorIndex,muttrcUnColorIndexNL
390syntax region muttrcUnColorLine keepend start=+^\s*uncolor\s+ skip=+\\$+ end=+$+ contains=muttrcUnColorKeyword,muttrcComment,muttrcUnHighlightSpace
391
392syntax keyword muttrcMonoAttrib	contained bold italic none normal reverse standout underline
393syntax keyword muttrcMono	contained mono		skipwhite nextgroup=muttrcColorField,muttrcColorCompose
394syntax match   muttrcMonoLine	"^\s*mono\s\+\S\+"	skipwhite nextgroup=muttrcMonoAttrib contains=muttrcMono
395
396" CHECKED 2024 Oct 12
397" List of fields in ColorFields in color/command.c
398syntax keyword muttrcColorField skipwhite contained
399	\ attachment attach_headers body bold error hdrdefault header index index_author
400	\ index_collapsed index_date index_flags index_label index_number index_size index_subject
401	\ index_tag index_tags indicator italic markers message normal options progress prompt
402	\ search sidebar_background sidebar_divider sidebar_flagged sidebar_highlight
403	\ sidebar_indicator sidebar_new sidebar_ordinary sidebar_spool_file sidebar_unread signature
404	\ status stripe_even stripe_odd tilde tree underline warning
405	\ nextgroup=muttrcColor
406
407syntax match   muttrcColorField	contained "\<quoted\d\=\>"
408
409syntax match muttrcColorCompose skipwhite contained /\s*compose\s*/ nextgroup=muttrcColorComposeField
410
411" CHECKED 2024 Oct 12
412" List of fields in ComposeColorFields in color/command.c
413syntax keyword muttrcColorComposeField skipwhite contained
414	\ header security_both security_encrypt security_none security_sign
415	\ nextgroup=muttrcColorFG,muttrcColorFGNL
416syntax region muttrcColorLine keepend start=/^\s*color\s\+/ skip=+\\$+ end=+$+ contains=muttrcColorKeyword,muttrcComment,muttrcUnHighlightSpace
417
418function! s:boolQuadGen(type, vars, deprecated)
419	let l:novars = copy(a:vars)
420	call map(l:novars, '"no" . v:val')
421	let l:invvars = copy(a:vars)
422	call map(l:invvars, '"inv" . v:val')
423
424	let l:orig_type = copy(a:type)
425	if a:deprecated
426		let l:type = 'Deprecated' . a:type
427		exec 'syntax keyword muttrcVar' . l:type . ' ' . join(a:vars)
428		exec 'syntax keyword muttrcVar' . l:type . ' ' . join(l:novars)
429		exec 'syntax keyword muttrcVar' . l:type . ' ' . join(l:invvars)
430	else
431		let l:type = a:type
432		exec 'syntax keyword muttrcVar' . l:type . ' skipwhite contained ' . join(a:vars) . ' nextgroup=muttrcSet' . l:orig_type . 'Assignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString'
433		exec 'syntax keyword muttrcVar' . l:type . ' skipwhite contained ' . join(l:novars) . ' nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString'
434		exec 'syntax keyword muttrcVar' . l:type . ' skipwhite contained ' . join(l:invvars) . ' nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString'
435	endif
436
437endfunction
438
439" CHECKED 2024 Oct 12
440" List of DT_BOOL in MuttVars in mutt_config.c
441call s:boolQuadGen('Bool', [
442	\ 'abort_backspace', 'allow_8bit', 'allow_ansi', 'arrow_cursor', 'ascii_chars', 'ask_bcc',
443	\ 'ask_cc', 'ask_followup_to', 'ask_x_comment_to', 'attach_save_without_prompting',
444	\ 'attach_split', 'autocrypt', 'autocrypt_reply', 'auto_edit', 'auto_subscribe', 'auto_tag',
445	\ 'beep', 'beep_new', 'bounce_delivered', 'braille_friendly',
446	\ 'browser_abbreviate_mailboxes', 'browser_sort_dirs_first', 'change_folder_next',
447	\ 'check_mbox_size', 'check_new', 'collapse_all', 'collapse_flagged', 'collapse_unread',
448	\ 'color_directcolor', 'compose_confirm_detach_first', 'compose_show_user_headers',
449	\ 'confirm_append', 'confirm_create', 'copy_decode_weed', 'count_alternatives',
450	\ 'crypt_auto_encrypt', 'crypt_auto_pgp', 'crypt_auto_sign', 'crypt_auto_smime',
451	\ 'crypt_confirm_hook', 'crypt_encryption_info', 'crypt_opportunistic_encrypt',
452	\ 'crypt_opportunistic_encrypt_strong_keys', 'crypt_protected_headers_read',
453	\ 'crypt_protected_headers_save', 'crypt_protected_headers_weed',
454	\ 'crypt_protected_headers_write', 'crypt_reply_encrypt', 'crypt_reply_sign',
455	\ 'crypt_reply_sign_encrypted', 'crypt_timestamp', 'crypt_use_gpgme', 'crypt_use_pka',
456	\ 'delete_untag', 'digest_collapse', 'duplicate_threads', 'edit_headers', 'encode_from',
457	\ 'fast_reply', 'fcc_before_send', 'fcc_clear', 'flag_safe', 'followup_to', 'force_name',
458	\ 'forward_decode', 'forward_decrypt', 'forward_quote', 'forward_references', 'hdrs',
459	\ 'header', 'header_color_partial', 'help', 'hidden_host', 'hide_limited', 'hide_missing',
460	\ 'hide_thread_subject', 'hide_top_limited', 'hide_top_missing', 'history_remove_dups',
461	\ 'honor_disposition', 'idn_decode', 'idn_encode', 'ignore_list_reply_to',
462	\ 'imap_check_subscribed', 'imap_condstore', 'imap_deflate', 'imap_idle',
463	\ 'imap_list_subscribed', 'imap_passive', 'imap_peek', 'imap_qresync', 'imap_rfc5161',
464	\ 'imap_send_id', 'imap_server_noise', 'implicit_auto_view', 'include_encrypted',
465	\ 'include_only_first', 'keep_flagged', 'local_date_header', 'mailcap_sanitize',
466	\ 'maildir_check_cur', 'maildir_header_cache_verify', 'maildir_trash', 'mail_check_recent',
467	\ 'mail_check_stats', 'markers', 'mark_old', 'menu_move_off', 'menu_scroll',
468	\ 'message_cache_clean', 'meta_key', 'me_too', 'mh_purge', 'mime_forward_decode',
469	\ 'mime_type_query_first', 'narrow_tree', 'nm_query_window_enable', 'nm_record',
470	\ 'nntp_listgroup', 'nntp_load_description', 'pager_stop', 'pgp_auto_decode',
471	\ 'pgp_auto_inline', 'pgp_check_exit', 'pgp_check_gpg_decrypt_status_fd',
472	\ 'pgp_ignore_subkeys', 'pgp_long_ids', 'pgp_reply_inline', 'pgp_retainable_sigs',
473	\ 'pgp_self_encrypt', 'pgp_show_unusable', 'pgp_strict_enc', 'pgp_use_gpg_agent',
474	\ 'pipe_decode', 'pipe_decode_weed', 'pipe_split', 'pop_auth_try_all', 'pop_last',
475	\ 'postpone_encrypt', 'print_decode', 'print_decode_weed', 'print_split', 'prompt_after',
476	\ 'read_only', 'reflow_space_quotes', 'reflow_text', 'reply_self', 'reply_with_xorig',
477	\ 'resolve', 'resume_draft_files', 'resume_edited_draft_files', 'reverse_alias',
478	\ 'reverse_name', 'reverse_real_name', 'rfc2047_parameters', 'save_address', 'save_empty',
479	\ 'save_name', 'save_unsubscribed', 'score', 'show_new_news', 'show_only_unread',
480	\ 'sidebar_folder_indent', 'sidebar_new_mail_only', 'sidebar_next_new_wrap',
481	\ 'sidebar_non_empty_mailbox_only', 'sidebar_on_right', 'sidebar_short_path',
482	\ 'sidebar_visible', 'sig_dashes', 'sig_on_top', 'size_show_bytes', 'size_show_fractions',
483	\ 'size_show_mb', 'size_units_on_left', 'smart_wrap', 'smime_ask_cert_label',
484	\ 'smime_decrypt_use_default_key', 'smime_is_default', 'smime_self_encrypt', 'sort_re',
485	\ 'ssl_force_tls', 'ssl_use_sslv2', 'ssl_use_sslv3', 'ssl_use_system_certs',
486	\ 'ssl_use_tlsv1', 'ssl_use_tlsv1_1', 'ssl_use_tlsv1_2', 'ssl_use_tlsv1_3',
487	\ 'ssl_verify_dates', 'ssl_verify_host', 'ssl_verify_partial_chains', 'status_on_top',
488	\ 'strict_threads', 'suspend', 'text_flowed', 'thorough_search', 'thread_received', 'tilde',
489	\ 'ts_enabled', 'tunnel_is_secure', 'uncollapse_jump', 'uncollapse_new', 'user_agent',
490	\ 'use_8bit_mime', 'use_domain', 'use_envelope_from', 'use_from', 'use_ipv6',
491	\ 'virtual_spool_file', 'wait_key', 'weed', 'wrap_search', 'write_bcc', 'x_comment_to'
492	\ ], 0)
493
494" CHECKED 2024 Oct 12
495" Deprecated Bools
496" List of DT_SYNONYM or DT_DEPRECATED Bools in MuttVars in mutt_config.c
497call s:boolQuadGen('Bool', [
498	\ 'askbcc', 'askcc', 'ask_follow_up', 'autoedit', 'confirmappend', 'confirmcreate',
499	\ 'crypt_autoencrypt', 'crypt_autopgp', 'crypt_autosign', 'crypt_autosmime',
500	\ 'crypt_confirmhook', 'crypt_replyencrypt', 'crypt_replysign', 'crypt_replysignencrypted',
501	\ 'cursor_overlay', 'edit_hdrs', 'envelope_from', 'forw_decode', 'forw_decrypt',
502	\ 'forw_quote', 'header_cache_compress', 'ignore_linear_white_space', 'imap_servernoise',
503	\ 'implicit_autoview', 'include_onlyfirst', 'metoo', 'mime_subject', 'pgp_autoencrypt',
504	\ 'pgp_autoinline', 'pgp_autosign', 'pgp_auto_traditional', 'pgp_create_traditional',
505	\ 'pgp_replyencrypt', 'pgp_replyinline', 'pgp_replysign', 'pgp_replysignencrypted',
506	\ 'pgp_self_encrypt_as', 'reverse_realname', 'smime_self_encrypt_as', 'ssl_usesystemcerts',
507	\ 'use_8bitmime', 'virtual_spoolfile', 'xterm_set_titles'
508	\ ], 1)
509
510" CHECKED 2024 Oct 12
511" List of DT_QUAD in MuttVars in mutt_config.c
512call s:boolQuadGen('Quad', [
513	\ 'abort_noattach', 'abort_nosubject', 'abort_unmodified', 'bounce', 'catchup_newsgroup',
514	\ 'copy', 'crypt_verify_sig', 'delete', 'fcc_attach', 'followup_to_poster',
515	\ 'forward_attachments', 'forward_edit', 'honor_followup_to', 'include', 'mime_forward',
516	\ 'mime_forward_rest', 'move', 'pgp_mime_auto', 'pop_delete', 'pop_reconnect', 'postpone',
517	\ 'post_moderated', 'print', 'quit', 'recall', 'reply_to', 'ssl_starttls'
518	\ ], 0)
519
520" CHECKED 2024 Oct 12
521" Deprecated Quads
522" List of DT_SYNONYM or DT_DEPRECATED Quads in MuttVars in mutt_config.c
523call s:boolQuadGen('Quad', [
524	\ 'mime_fwd', 'pgp_encrypt_self', 'pgp_verify_sig', 'smime_encrypt_self'
525	\ ], 1)
526
527" CHECKED 2024 Oct 12
528" List of DT_NUMBER or DT_LONG in MuttVars in mutt_config.c
529syntax keyword muttrcVarNum	skipwhite contained
530	\ debug_level header_cache_compress_level history imap_fetch_chunk_size imap_keep_alive
531	\ imap_pipeline_depth imap_poll_timeout mail_check mail_check_stats_interval menu_context
532	\ net_inc nm_db_limit nm_open_timeout nm_query_window_current_position
533	\ nm_query_window_duration nntp_context nntp_poll pager_context pager_index_lines
534	\ pager_read_delay pager_skip_quoted_context pgp_timeout pop_check_interval read_inc
535	\ reflow_wrap save_history score_threshold_delete score_threshold_flag score_threshold_read
536	\ search_context sendmail_wait sidebar_component_depth sidebar_width sleep_time
537	\ smime_timeout socket_timeout ssl_min_dh_prime_bits timeout time_inc
538	\ toggle_quoted_show_levels wrap wrap_headers write_inc
539	\ nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
540" CHECKED 2024 Oct 12
541" Deprecated Numbers
542syntax keyword muttrcVarDeprecatedNum
543	\ connect_timeout header_cache_pagesize imap_keepalive pop_checkinterval skip_quoted_offset
544
545" CHECKED 2024 Oct 12
546" List of DT_STRING in MuttVars in mutt_config.c
547" Special cases first, and all the rest at the end
548" Formats themselves must be updated in their respective groups
549" See s:escapesConditionals
550syntax match   muttrcVarString	contained skipwhite 'my_[a-zA-Z0-9_]\+' nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
551syntax keyword muttrcVarString	contained skipwhite alias_format nextgroup=muttrcVarEqualsAliasFormat
552syntax keyword muttrcVarString	contained skipwhite attach_format nextgroup=muttrcVarEqualsAttachFormat
553syntax keyword muttrcVarString	contained skipwhite autocrypt_acct_format nextgroup=muttrcVarEqualsAutocryptFormat
554syntax keyword muttrcVarString	contained skipwhite compose_format nextgroup=muttrcVarEqualsComposeFormat
555syntax keyword muttrcVarString	contained skipwhite folder_format mailbox_folder_format nextgroup=muttrcVarEqualsFolderFormat
556syntax keyword muttrcVarString	contained skipwhite greeting nextgroup=muttrcVarEqualsGreetingFormat
557syntax keyword muttrcVarString	contained skipwhite history_format nextgroup=muttrcVarEqualsHistoryFormat
558syntax keyword muttrcVarString	contained skipwhite
559	\ attribution_intro attribution_trailer forward_attribution_intro forward_attribution_trailer
560	\ forward_format indent_string index_format message_format pager_format
561	\ nextgroup=muttrcVarEqualsIndexFormat
562syntax keyword muttrcVarString	contained skipwhite pattern_format nextgroup=muttrcVarEqualsPatternFormat
563syntax keyword muttrcVarString	contained skipwhite
564	\ pgp_clear_sign_command pgp_decode_command pgp_decrypt_command pgp_encrypt_only_command
565	\ pgp_encrypt_sign_command pgp_export_command pgp_get_keys_command pgp_import_command
566	\ pgp_list_pubring_command pgp_list_secring_command pgp_sign_command pgp_verify_command
567	\ pgp_verify_key_command
568	\ nextgroup=muttrcVarEqualsPgpCommandFormat
569syntax keyword muttrcVarString	contained skipwhite pgp_entry_format nextgroup=muttrcVarEqualsPgpEntryFormat
570syntax keyword muttrcVarString	contained skipwhite query_format nextgroup=muttrcVarEqualsQueryFormat
571syntax keyword muttrcVarString	contained skipwhite
572	\ smime_decrypt_command smime_encrypt_command smime_get_cert_command
573	\ smime_get_cert_email_command smime_get_signer_cert_command smime_import_cert_command
574	\ smime_pk7out_command smime_sign_command smime_verify_command smime_verify_opaque_command
575	\ nextgroup=muttrcVarEqualsSmimeCommandFormat
576syntax keyword muttrcVarString	contained skipwhite status_format ts_icon_format ts_status_format nextgroup=muttrcVarEqualsStatusFormat
577syntax keyword muttrcVarString	contained skipwhite date_format nextgroup=muttrcVarEqualsStrftimeFormat
578syntax keyword muttrcVarString	contained skipwhite group_index_format nextgroup=muttrcVarEqualsGroupIndexFormat
579syntax keyword muttrcVarString	contained skipwhite sidebar_format nextgroup=muttrcVarEqualsSidebarFormat
580syntax keyword muttrcVarString	contained skipwhite
581	\ abort_key arrow_string assumed_charset attach_charset attach_sep attribution_locale
582	\ charset config_charset content_type crypt_protected_headers_subject default_hook
583	\ dsn_notify dsn_return empty_subject header_cache_backend header_cache_compress_method
584	\ hidden_tags hostname imap_authenticators imap_delim_chars imap_headers imap_login
585	\ imap_pass imap_user mailcap_path maildir_field_delimiter mark_macro_prefix mh_seq_flagged
586	\ mh_seq_replied mh_seq_unseen newsgroups_charset newsrc news_server nm_config_profile
587	\ nm_default_url nm_exclude_tags nm_flagged_tag nm_query_type nm_query_window_current_search
588	\ nm_query_window_or_terms nm_query_window_timebase nm_record_tags nm_replied_tag
589	\ nm_unread_tag nntp_authenticators nntp_pass nntp_user pgp_default_key pgp_sign_as pipe_sep
590	\ pop_authenticators pop_host pop_pass pop_user postpone_encrypt_as preconnect
591	\ preferred_languages real_name send_charset show_multipart_alternative sidebar_delim_chars
592	\ sidebar_divider_char sidebar_indent_string simple_search smime_default_key
593	\ smime_encrypt_with smime_sign_as smime_sign_digest_alg smtp_authenticators smtp_pass
594	\ smtp_url smtp_user spam_separator ssl_ciphers
595	\ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
596
597" Deprecated strings
598syntax keyword muttrcVarDeprecatedString
599	\ abort_noattach_regexp attach_keyword attribution escape forw_format hdr_format indent_str
600	\ message_cachedir mixmaster mix_entry_format msg_format nm_default_uri
601	\ pgp_clearsign_command pgp_getkeys_command pgp_self_encrypt_as post_indent_str
602	\ post_indent_string print_cmd quote_regexp realname reply_regexp smime_self_encrypt_as
603	\ spoolfile tmpdir vfolder_format visual xterm_icon xterm_title
604
605" CHECKED 2024 Oct 12
606" List of DT_ADDRESS
607syntax keyword muttrcVarString	contained skipwhite envelope_from_address from nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
608" List of DT_ENUM
609syntax keyword muttrcVarString	contained skipwhite mbox_type use_threads nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
610" List of DT_MBTABLE
611syntax keyword muttrcVarString	contained skipwhite crypt_chars flag_chars from_chars status_chars to_chars nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
612
613" CHECKED 2024 Oct 12
614" List of DT_PATH or D_STRING_MAILBOX
615syntax keyword muttrcVarString	contained skipwhite
616	\ alias_file attach_save_dir autocrypt_dir certificate_file debug_file entropy_file folder
617	\ header_cache history_file mbox message_cache_dir news_cache_dir nm_config_file postponed
618	\ record signature smime_ca_location smime_certificates smime_keys spool_file
619	\ ssl_ca_certificates_file ssl_client_cert tmp_dir trash
620	\ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
621" List of DT_COMMAND (excluding pgp_*_command and smime_*_command)
622syntax keyword muttrcVarString	contained skipwhite
623	\ account_command display_filter editor external_search_command imap_oauth_refresh_command
624	\ inews ispell mime_type_query_command new_mail_command pager pop_oauth_refresh_command
625	\ print_command query_command sendmail shell smtp_oauth_refresh_command tunnel
626	\ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
627
628" CHECKED 2024 Oct 12
629" List of DT_REGEX
630syntax keyword muttrcVarString	contained skipwhite
631	\ abort_noattach_regex gecos_mask mask pgp_decryption_okay pgp_good_sign quote_regex
632	\ reply_regex smileys
633	\ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
634" List of DT_SORT
635syntax keyword muttrcVarString	contained skipwhite
636	\ pgp_sort_keys sidebar_sort_method sort sort_alias sort_aux sort_browser
637	\ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
638
639" CHECKED 2024 Oct 12
640" List of commands in mutt_commands in commands.c
641" Remember to remove hooks, they have already been dealt with
642syntax keyword muttrcCommand	skipwhite alias nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL
643syntax keyword muttrcCommand	skipwhite bind nextgroup=muttrcBindMenuList,muttrcBindMenuListNL
644syntax keyword muttrcCommand	skipwhite exec nextgroup=muttrcFunction
645syntax keyword muttrcCommand	skipwhite macro nextgroup=muttrcMacroMenuList,muttrcMacroMenuListNL
646syntax keyword muttrcCommand	skipwhite nospam nextgroup=muttrcNoSpamPattern
647syntax keyword muttrcCommand	skipwhite set unset reset toggle nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarString
648syntax keyword muttrcCommand	skipwhite spam nextgroup=muttrcSpamPattern
649syntax keyword muttrcCommand	skipwhite unalias nextgroup=muttrcUnAliasKey,muttrcUnAliasNL
650syntax keyword muttrcCommand	skipwhite unhook nextgroup=muttrcHooks
651syntax keyword muttrcCommand	skipwhite
652	\ alternative_order attachments auto_view cd echo finish hdr_order ifdef ifndef ignore lua
653	\ lua-source mailboxes mailto_allow mime_lookup my_hdr named-mailboxes push score setenv
654	\ sidebar_pin sidebar_unpin source subjectrx subscribe-to tag-formats tag-transforms
655	\ unalternative_order unattachments unauto_view unbind uncolor unhdr_order unignore unmacro
656	\ unmailboxes unmailto_allow unmime_lookup unmono unmy_hdr unscore unsetenv unsubjectrx
657	\ unsubscribe-from unvirtual-mailboxes version virtual-mailboxes
658
659" CHECKED 2024 Oct 12
660" Deprecated commands
661syntax keyword muttrcDeprecatedCommand skipwhite
662	\ sidebar_whitelist unsidebar_whitelist
663
664function! s:genFunctions(functions)
665	for f in a:functions
666		exec 'syntax match muttrcFunction contained "\<' . l:f . '\>"'
667	endfor
668endfunction
669
670" CHECKED 2024 Oct 12
671" List of functions in functions.c
672" Note: 'noop' is included but is elsewhere in the source
673call s:genFunctions(['noop',
674	\ 'alias-dialog', 'attach-file', 'attach-key', 'attach-message', 'attach-news-message',
675	\ 'autocrypt-acct-menu', 'autocrypt-menu', 'backspace', 'backward-char', 'backward-word',
676	\ 'bol', 'bottom', 'bottom-page', 'bounce-message', 'break-thread', 'buffy-cycle',
677	\ 'buffy-list', 'capitalize-word', 'catchup', 'change-dir', 'change-folder',
678	\ 'change-folder-readonly', 'change-newsgroup', 'change-newsgroup-readonly',
679	\ 'change-vfolder', 'check-new', 'check-stats', 'check-traditional-pgp', 'clear-flag',
680	\ 'collapse-all', 'collapse-parts', 'collapse-thread', 'complete', 'complete-query',
681	\ 'compose-to-sender', 'copy-file', 'copy-message', 'create-account', 'create-alias',
682	\ 'create-mailbox', 'current-bottom', 'current-middle', 'current-top', 'decode-copy',
683	\ 'decode-save', 'decrypt-copy', 'decrypt-save', 'delete-account', 'delete-char',
684	\ 'delete-entry', 'delete-mailbox', 'delete-message', 'delete-pattern', 'delete-subthread',
685	\ 'delete-thread', 'descend-directory', 'detach-file', 'display-address',
686	\ 'display-filename', 'display-message', 'display-toggle-weed', 'downcase-word', 'edit',
687	\ 'edit-bcc', 'edit-cc', 'edit-content-id', 'edit-description', 'edit-encoding', 'edit-fcc',
688	\ 'edit-file', 'edit-followup-to', 'edit-from', 'edit-headers', 'edit-label',
689	\ 'edit-language', 'edit-message', 'edit-mime', 'edit-newsgroups',
690	\ 'edit-or-view-raw-message', 'edit-raw-message', 'edit-reply-to', 'edit-subject',
691	\ 'edit-to', 'edit-type', 'edit-x-comment-to', 'end-cond', 'enter-command', 'enter-mask',
692	\ 'entire-thread', 'eol', 'error-history', 'exit', 'extract-keys', 'fetch-mail',
693	\ 'filter-entry', 'first-entry', 'flag-message', 'followup-message', 'forget-passphrase',
694	\ 'forward-char', 'forward-message', 'forward-to-group', 'forward-word', 'get-attachment',
695	\ 'get-children', 'get-message', 'get-parent', 'goto-folder', 'goto-parent',
696	\ 'group-alternatives', 'group-chat-reply', 'group-multilingual', 'group-related',
697	\ 'group-reply', 'half-down', 'half-up', 'help', 'history-down', 'history-search',
698	\ 'history-up', 'imap-fetch-mail', 'imap-logout-all', 'ispell', 'jump', 'kill-eol',
699	\ 'kill-eow', 'kill-line', 'kill-whole-line', 'kill-word', 'last-entry', 'limit',
700	\ 'limit-current-thread', 'link-threads', 'list-reply', 'list-subscribe',
701	\ 'list-unsubscribe', 'mail', 'mail-key', 'mailbox-cycle', 'mailbox-list', 'mark-as-new',
702	\ 'mark-message', 'middle-page', 'modify-labels', 'modify-labels-then-hide', 'modify-tags',
703	\ 'modify-tags-then-hide', 'move-down', 'move-up', 'new-mime', 'next-entry', 'next-line',
704	\ 'next-new', 'next-new-then-unread', 'next-page', 'next-subthread', 'next-thread',
705	\ 'next-undeleted', 'next-unread', 'next-unread-mailbox', 'parent-message', 'pgp-menu',
706	\ 'pipe-entry', 'pipe-message', 'post-message', 'postpone-message', 'previous-entry',
707	\ 'previous-line', 'previous-new', 'previous-new-then-unread', 'previous-page',
708	\ 'previous-subthread', 'previous-thread', 'previous-undeleted', 'previous-unread',
709	\ 'print-entry', 'print-message', 'purge-message', 'purge-thread', 'quasi-delete', 'query',
710	\ 'query-append', 'quit', 'quote-char', 'read-subthread', 'read-thread', 'recall-message',
711	\ 'reconstruct-thread', 'redraw-screen', 'refresh', 'reload-active', 'rename-attachment',
712	\ 'rename-file', 'rename-mailbox', 'reply', 'resend-message', 'root-message', 'save-entry',
713	\ 'save-message', 'search', 'search-next', 'search-opposite', 'search-reverse',
714	\ 'search-toggle', 'select-entry', 'select-new', 'send-message', 'set-flag', 'shell-escape',
715	\ 'show-limit', 'show-log-messages', 'show-version', 'sidebar-first', 'sidebar-last',
716	\ 'sidebar-next', 'sidebar-next-new', 'sidebar-open', 'sidebar-page-down',
717	\ 'sidebar-page-up', 'sidebar-prev', 'sidebar-prev-new', 'sidebar-toggle-virtual',
718	\ 'sidebar-toggle-visible', 'skip-headers', 'skip-quoted', 'smime-menu', 'sort',
719	\ 'sort-alias', 'sort-alias-reverse', 'sort-mailbox', 'sort-reverse', 'subscribe',
720	\ 'subscribe-pattern', 'sync-mailbox', 'tag-entry', 'tag-message', 'tag-pattern',
721	\ 'tag-prefix', 'tag-prefix-cond', 'tag-subthread', 'tag-thread', 'toggle-active',
722	\ 'toggle-disposition', 'toggle-mailboxes', 'toggle-new', 'toggle-prefer-encrypt',
723	\ 'toggle-quoted', 'toggle-read', 'toggle-recode', 'toggle-subscribed', 'toggle-unlink',
724	\ 'toggle-write', 'top', 'top-page', 'transpose-chars', 'uncatchup', 'undelete-entry',
725	\ 'undelete-message', 'undelete-pattern', 'undelete-subthread', 'undelete-thread',
726	\ 'ungroup-attachment', 'unsubscribe', 'unsubscribe-pattern', 'untag-pattern',
727	\ 'upcase-word', 'update-encoding', 'verify-key', 'vfolder-from-query',
728	\ 'vfolder-from-query-readonly', 'vfolder-window-backward', 'vfolder-window-forward',
729	\ 'vfolder-window-reset', 'view-attach', 'view-attachments', 'view-file', 'view-mailcap',
730	\ 'view-name', 'view-pager', 'view-raw-message', 'view-text', 'what-key', 'write-fcc'
731	\ ])
732
733" Define the default highlighting.
734" Only when an item doesn't have highlighting yet
735
736highlight def link muttrcSetBoolAssignment		Boolean
737highlight def link muttrcSetQuadAssignment		Boolean
738
739highlight def link muttrcComment			Comment
740
741highlight def link muttrcAlternatesLine			Error
742highlight def link muttrcBadAction			Error
743highlight def link muttrcBindFunction			Error
744highlight def link muttrcBindMenuList			Error
745highlight def link muttrcColorBG			Error
746highlight def link muttrcColorContext			Error
747highlight def link muttrcColorFG			Error
748highlight def link muttrcColorLine			Error
749highlight def link muttrcDeprecatedCommand		Error
750highlight def link muttrcFormatErrors			Error
751highlight def link muttrcGroupLine			Error
752highlight def link muttrcPattern			Error
753highlight def link muttrcUnColorLine			Error
754highlight def link muttrcVarDeprecatedBool		Error
755highlight def link muttrcVarDeprecatedNum		Error
756highlight def link muttrcVarDeprecatedQuad		Error
757highlight def link muttrcVarDeprecatedString		Error
758
759highlight def link muttrcAliasEncEmail			Identifier
760highlight def link muttrcAliasKey			Identifier
761highlight def link muttrcColorCompose			Identifier
762highlight def link muttrcColorComposeField		Identifier
763highlight def link muttrcColorField			Identifier
764highlight def link muttrcMenu				Identifier
765highlight def link muttrcSimplePat			Identifier
766highlight def link muttrcUnAliasKey			Identifier
767highlight def link muttrcUnColorIndex			Identifier
768highlight def link muttrcVarBool			Identifier
769highlight def link muttrcVarNum				Identifier
770highlight def link muttrcVarQuad			Identifier
771highlight def link muttrcVarString			Identifier
772
773highlight def link muttrcCommand			Keyword
774
775highlight def link muttrcAction				Macro
776highlight def link muttrcAliasGroupName			Macro
777highlight def link muttrcFunction			Macro
778highlight def link muttrcGroupDef			Macro
779highlight def link muttrcSimplePatString		Macro
780
781highlight def link muttrcMonoAttrib			muttrcColor
782
783highlight def link muttrcAlternateKeyword		muttrcCommand
784highlight def link muttrcAttachmentsLine		muttrcCommand
785highlight def link muttrcColorKeyword			muttrcCommand
786highlight def link muttrcGroupKeyword			muttrcCommand
787highlight def link muttrcListsKeyword			muttrcCommand
788highlight def link muttrcMono				muttrcCommand
789highlight def link muttrcPatHooks			muttrcCommand
790highlight def link muttrcRXHooks			muttrcCommand
791highlight def link muttrcSubscribeKeyword		muttrcCommand
792highlight def link muttrcUnColorKeyword			muttrcCommand
793
794highlight def link muttrcAliasFormatEscapes		muttrcEscape
795highlight def link muttrcAttachFormatEscapes		muttrcEscape
796highlight def link muttrcAutocryptFormatEscapes		muttrcEscape
797highlight def link muttrcComposeFormatEscapes		muttrcEscape
798highlight def link muttrcFolderFormatEscapes		muttrcEscape
799highlight def link muttrcGreetingFormatEscapes		muttrcEscape
800highlight def link muttrcGroupIndexFormatEscapes	muttrcEscape
801highlight def link muttrcHistoryFormatEscapes		muttrcEscape
802highlight def link muttrcIndexFormatEscapes		muttrcEscape
803highlight def link muttrcPatternFormatEscapes		muttrcEscape
804highlight def link muttrcPgpCommandFormatEscapes	muttrcEscape
805highlight def link muttrcPgpEntryFormatEscapes		muttrcEscape
806highlight def link muttrcPgpTimeEscapes			muttrcEscape
807highlight def link muttrcQueryFormatEscapes		muttrcEscape
808highlight def link muttrcShellString			muttrcEscape
809highlight def link muttrcSidebarFormatEscapes		muttrcEscape
810highlight def link muttrcSmimeCommandFormatEscapes	muttrcEscape
811highlight def link muttrcStatusFormatEscapes		muttrcEscape
812highlight def link muttrcTimeEscapes			muttrcEscape
813
814highlight def link muttrcAliasFormatConditionals	 muttrcFormatConditionals2
815highlight def link muttrcAttachFormatConditionals	 muttrcFormatConditionals2
816highlight def link muttrcAutocryptFormatConditionals	 muttrcFormatConditionals2
817highlight def link muttrcComposeFormatConditionals	 muttrcFormatConditionals2
818highlight def link muttrcFolderFormatConditionals	 muttrcFormatConditionals2
819highlight def link muttrcGreetingFormatConditionals	 muttrcFormatConditionals2
820highlight def link muttrcGroupIndexFormatConditionals	 muttrcFormatConditionals2
821highlight def link muttrcHistoryFormatConditionals	 muttrcFormatConditionals2
822highlight def link muttrcIndexFormatConditionals	 muttrcFormatConditionals2
823highlight def link muttrcPatternFormatConditionals	 muttrcFormatConditionals2
824highlight def link muttrcPgpCommandFormatConditionals	 muttrcFormatConditionals2
825highlight def link muttrcPgpEntryFormatConditionals	 muttrcFormatConditionals2
826highlight def link muttrcQueryFormatConditionals	 muttrcFormatConditionals2
827highlight def link muttrcSidebarFormatConditionals	 muttrcFormatConditionals2
828highlight def link muttrcSmimeCommandFormatConditionals	 muttrcFormatConditionals2
829highlight def link muttrcStatusFormatConditionals	 muttrcFormatConditionals2
830
831highlight def link muttrcAddrDef			muttrcGroupFlag
832highlight def link muttrcRXDef				muttrcGroupFlag
833
834highlight def link muttrcAliasFormatString		muttrcString
835highlight def link muttrcAttachFormatString		muttrcString
836highlight def link muttrcAutocryptFormatString		muttrcString
837highlight def link muttrcComposeFormatString		muttrcString
838highlight def link muttrcFolderFormatString		muttrcString
839highlight def link muttrcGreetingFormatString		muttrcString
840highlight def link muttrcGroupIndexFormatString		muttrcString
841highlight def link muttrcHistoryFormatString		muttrcString
842highlight def link muttrcIndexFormatString		muttrcString
843highlight def link muttrcPatternFormatString		muttrcString
844highlight def link muttrcPgpCommandFormatString		muttrcString
845highlight def link muttrcPgpEntryFormatString		muttrcString
846highlight def link muttrcQueryFormatString		muttrcString
847highlight def link muttrcSidebarFormatString		muttrcString
848highlight def link muttrcSmimeCommandFormatString	muttrcString
849highlight def link muttrcStatusFormatString		muttrcString
850highlight def link muttrcStrftimeFormatString		muttrcString
851
852highlight def link muttrcSetNumAssignment		Number
853
854highlight def link muttrcEmail				Special
855highlight def link muttrcSimplePatMetas			Special
856highlight def link muttrcSpecial			Special
857highlight def link muttrcVariableInner			Special
858
859highlight def link muttrcAliasEncEmailNL		SpecialChar
860highlight def link muttrcAliasENNL			SpecialChar
861highlight def link muttrcAliasGroupDefNL		SpecialChar
862highlight def link muttrcAliasNameNL			SpecialChar
863highlight def link muttrcAliasNL			SpecialChar
864highlight def link muttrcBindFunctionNL			SpecialChar
865highlight def link muttrcBindKeyNL			SpecialChar
866highlight def link muttrcBindMenuListNL			SpecialChar
867highlight def link muttrcColorBGNL			SpecialChar
868highlight def link muttrcColorFGNL			SpecialChar
869highlight def link muttrcColorMatchCountNL		SpecialChar
870highlight def link muttrcColorNL			SpecialChar
871highlight def link muttrcColorRXNL			SpecialChar
872highlight def link muttrcEscape				SpecialChar
873highlight def link muttrcKeyName			SpecialChar
874highlight def link muttrcKeySpecial			SpecialChar
875highlight def link muttrcMacroBodyNL			SpecialChar
876highlight def link muttrcMacroDescrNL			SpecialChar
877highlight def link muttrcMacroKeyNL			SpecialChar
878highlight def link muttrcMacroMenuListNL		SpecialChar
879highlight def link muttrcRXChars			SpecialChar
880highlight def link muttrcStringNL			SpecialChar
881highlight def link muttrcUnAliasNL			SpecialChar
882highlight def link muttrcUnColorAPNL			SpecialChar
883highlight def link muttrcUnColorIndexNL			SpecialChar
884highlight def link muttrcUnColorPatNL			SpecialChar
885
886highlight def link muttrcAttachmentsMimeType		String
887highlight def link muttrcEscapedVariable		String
888highlight def link muttrcMacroDescr			String
889highlight def link muttrcRXPat				String
890highlight def link muttrcRXString			String
891highlight def link muttrcRXString2			String
892highlight def link muttrcSetStrAssignment		String
893highlight def link muttrcString				String
894
895highlight def link muttrcAttachmentsFlag		Type
896highlight def link muttrcColor				Type
897highlight def link muttrcFormatConditionals2		Type
898highlight def link muttrcGroupFlag			Type
899highlight def link muttrcHeader				Type
900highlight def link muttrcHooks				Type
901highlight def link muttrcKey				Type
902highlight def link muttrcPatHookNot			Type
903highlight def link muttrcRXHookNot			Type
904highlight def link muttrcStrftimeEscapes		Type
905
906let b:current_syntax = "neomuttrc"
907
908let &cpo = s:cpo_save
909unlet s:cpo_save
910
911" vim: ts=8 noet tw=100 sw=8 sts=0 ft=vim isk+=-