xref: /vim-8.2.3635/runtime/syntax/nsis.vim (revision 51ad4eaa)
1" Vim syntax file
2" Language:		NSIS script, for version of NSIS 3.02 and later
3" Maintainer:		Ken Takata
4" URL:			https://github.com/k-takata/vim-nsis
5" Previous Maintainer:	Alex Jakushev <[email protected]>
6" Last Change:		2018-01-26
7
8" quit when a syntax file was already loaded
9if exists("b:current_syntax")
10  finish
11endif
12
13let s:cpo_save = &cpo
14set cpo&vim
15
16syn case ignore
17
18
19"Pseudo definitions
20syn match nsisLine nextgroup=@nsisPseudoStatement skipwhite "^"
21syn cluster nsisPseudoStatement	contains=nsisFirstComment,nsisLocalLabel,nsisGlobalLabel
22syn cluster nsisPseudoStatement add=nsisDefine,nsisPreCondit,nsisMacro,nsisInclude,nsisSystem
23syn cluster nsisPseudoStatement add=nsisAttribute,nsisCompiler,nsisVersionInfo,nsisInstruction,nsisStatement
24
25"COMMENTS (4.1)
26syn keyword nsisTodo	todo attention note fixme readme
27syn region nsisComment	start="[;#]" end="$" contains=nsisTodo,nsisLineContinuation,@Spell oneline
28syn region nsisComment	start=".\@1<=/\*" end="\*/" contains=nsisTodo,@Spell
29syn region nsisFirstComment  start="/\*" end="\*/" contained contains=nsisTodo,@Spell skipwhite
30			\ nextgroup=@nsisPseudoStatement
31
32syn match nsisLineContinuation	"\\$"
33
34"STRINGS (4.1)
35syn region nsisString	start=/"/ end=/"/ contains=@nsisStringItems,@Spell
36syn region nsisString	start=/'/ end=/'/ contains=@nsisStringItems,@Spell
37syn region nsisString	start=/`/ end=/`/ contains=@nsisStringItems,@Spell
38
39syn cluster nsisStringItems	contains=nsisPreprocSubst,nsisPreprocLangStr,nsisPreprocEnvVar,nsisUserVar,nsisSysVar,nsisRegistry,nsisLineContinuation
40
41"NUMBERS (4.1)
42syn match nsisNumber		"\<[1-9]\d*\>"
43syn match nsisNumber		"\<0x\x\+\>"
44syn match nsisNumber		"\<0\o*\>"
45
46"STRING REPLACEMENT (5.4, 4.9.15.2, 5.3.1)
47syn region nsisPreprocSubst	start="\${" end="}" contains=nsisPreprocSubst,nsisPreprocLangStr,nsisPreprocEnvVar
48syn region nsisPreprocLangStr	start="\$(" end=")" contains=nsisPreprocSubst,nsisPreprocLangStr,nsisPreprocEnvVar
49syn region nsisPreprocEnvVar	start="\$%" end="%" contains=nsisPreprocSubst,nsisPreprocLangStr,nsisPreprocEnvVar
50
51"VARIABLES (4.2.2)
52syn match nsisUserVar		"$\d"
53syn match nsisUserVar		"$R\d"
54syn match nsisSysVar		"$INSTDIR"
55syn match nsisSysVar		"$OUTDIR"
56syn match nsisSysVar		"$CMDLINE"
57syn match nsisSysVar		"$LANGUAGE"
58"CONSTANTS (4.2.3)
59syn match nsisSysVar		"$PROGRAMFILES"
60syn match nsisSysVar		"$PROGRAMFILES32"
61syn match nsisSysVar		"$PROGRAMFILES64"
62syn match nsisSysVar		"$COMMONFILES"
63syn match nsisSysVar		"$COMMONFILES32"
64syn match nsisSysVar		"$COMMONFILES64"
65syn match nsisSysVar		"$DESKTOP"
66syn match nsisSysVar		"$EXEDIR"
67syn match nsisSysVar		"$EXEFILE"
68syn match nsisSysVar		"$EXEPATH"
69syn match nsisSysVar		"${NSISDIR}"
70syn match nsisSysVar		"$WINDIR"
71syn match nsisSysVar		"$SYSDIR"
72syn match nsisSysVar		"$TEMP"
73syn match nsisSysVar		"$STARTMENU"
74syn match nsisSysVar		"$SMPROGRAMS"
75syn match nsisSysVar		"$SMSTARTUP"
76syn match nsisSysVar		"$QUICKLAUNCH"
77syn match nsisSysVar		"$DOCUMENTS"
78syn match nsisSysVar		"$SENDTO"
79syn match nsisSysVar		"$RECENT"
80syn match nsisSysVar		"$FAVORITES"
81syn match nsisSysVar		"$MUSIC"
82syn match nsisSysVar		"$PICTURES"
83syn match nsisSysVar		"$VIDEOS"
84syn match nsisSysVar		"$NETHOOD"
85syn match nsisSysVar		"$FONTS"
86syn match nsisSysVar		"$TEMPLATES"
87syn match nsisSysVar		"$APPDATA"
88syn match nsisSysVar		"$LOCALAPPDATA"
89syn match nsisSysVar		"$PRINTHOOD"
90syn match nsisSysVar		"$INTERNET_CACHE"
91syn match nsisSysVar		"$COOKIES"
92syn match nsisSysVar		"$HISTORY"
93syn match nsisSysVar		"$PROFILE"
94syn match nsisSysVar		"$ADMINTOOLS"
95syn match nsisSysVar		"$RESOURCES"
96syn match nsisSysVar		"$RESOURCES_LOCALIZED"
97syn match nsisSysVar		"$CDBURN_AREA"
98syn match nsisSysVar		"$HWNDPARENT"
99syn match nsisSysVar		"$PLUGINSDIR"
100syn match nsisSysVar		"$\\r"
101syn match nsisSysVar		"$\\n"
102syn match nsisSysVar		"$\\t"
103syn match nsisSysVar		"$\$"
104syn match nsisSysVar		"$\\["'`]"
105
106"LABELS (4.3)
107syn match nsisLocalLabel	contained "[^-+!$0-9;#. \t/*][^ \t:;#]*:\ze\%($\|[ \t;#]\|\/\*\)"
108syn match nsisGlobalLabel	contained "\.[^-+!$0-9;# \t/*][^ \t:;#]*:\ze\%($\|[ \t;#]\|\/\*\)"
109
110"CONSTANTS
111syn keyword nsisBoolean		contained true false
112syn keyword nsisOnOff		contained on off
113
114syn keyword nsisRegistry	contained HKCR HKLM HKCU HKU HKCC HKDD HKPD SHCTX
115syn keyword nsisRegistry	contained HKCR32 HKCR64 HKCU32 HKCU64 HKLM32 HKLM64
116syn keyword nsisRegistry	contained HKEY_CLASSES_ROOT HKEY_LOCAL_MACHINE HKEY_CURRENT_USER HKEY_USERS
117syn keyword nsisRegistry	contained HKEY_CLASSES_ROOT32 HKEY_CLASSES_ROOT64
118syn keyword nsisRegistry	contained HKEY_CURRENT_USER32 HKEY_CURRENT_USER64
119syn keyword nsisRegistry	contained HKEY_LOCAL_MACHINE32 HKEY_LOCAL_MACHINE64
120syn keyword nsisRegistry	contained HKEY_CURRENT_CONFIG HKEY_DYN_DATA HKEY_PERFORMANCE_DATA
121syn keyword nsisRegistry	contained SHELL_CONTEXT
122
123
124" common options
125syn cluster nsisAnyOpt		contains=nsisComment,nsisLineContinuation,nsisPreprocSubst,nsisPreprocLangStr,nsisPreprocEnvVar,nsisUserVar,nsisSysVar,nsisString,nsisNumber
126syn region nsisBooleanOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisBoolean
127syn region nsisOnOffOpt		contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisOnOff
128syn region nsisLangOpt		contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisLangKwd
129syn match nsisLangKwd		contained "/LANG\>"
130syn region nsisFontOpt		contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisFontKwd
131syn match nsisFontKwd		contained "/\%(ITALIC\|UNDERLINE\|STRIKE\)\>"
132
133"STATEMENTS - pages (4.5)
134syn keyword nsisStatement	contained Page UninstPage nextgroup=nsisPageOpt skipwhite
135syn region nsisPageOpt		contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisPageKwd
136syn keyword nsisPageKwd		contained custom license components directory instfiles uninstConfirm
137syn match nsisPageKwd		contained "/ENABLECANCEL\>"
138
139syn keyword nsisStatement	contained PageEx nextgroup=nsisPageExOpt skipwhite
140syn region nsisPageExOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisPageExKwd
141syn match nsisPageExKwd		contained "\<\%(un\.\)\?\%(custom\|license\|components\|directory\|instfiles\|uninstConfirm\)\>"
142
143syn keyword nsisStatement	contained PageExEnd PageCallbacks
144
145"STATEMENTS - sections (4.6.1)
146syn keyword nsisStatement	contained AddSize SectionEnd SectionGroupEnd
147
148syn keyword nsisStatement	contained Section nextgroup=nsisSectionOpt skipwhite
149syn region nsisSectionOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSectionKwd
150syn match nsisSectionKwd	contained "/o\>"
151
152syn keyword nsisStatement	contained SectionIn nextgroup=nsisSectionInOpt skipwhite
153syn region nsisSectionInOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSectionInKwd
154syn keyword nsisSectionInKwd	contained RO
155
156syn keyword nsisStatement	contained SectionGroup nextgroup=nsisSectionGroupOpt skipwhite
157syn region nsisSectionGroupOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSectionGroupKwd
158syn match nsisSectionGroupKwd	contained "/e\>"
159
160"STATEMENTS - functions (4.7.1)
161syn keyword nsisStatement	contained Function FunctionEnd
162
163
164"STATEMENTS - LogicLib.nsh
165syn match nsisStatement		"${If}"
166syn match nsisStatement		"${IfNot}"
167syn match nsisStatement		"${Unless}"
168syn match nsisStatement		"${ElseIf}"
169syn match nsisStatement		"${ElseIfNot}"
170syn match nsisStatement		"${ElseUnless}"
171syn match nsisStatement		"${Else}"
172syn match nsisStatement		"${EndIf}"
173syn match nsisStatement		"${EndUnless}"
174syn match nsisStatement		"${AndIf}"
175syn match nsisStatement		"${AndIfNot}"
176syn match nsisStatement		"${AndUnless}"
177syn match nsisStatement		"${OrIf}"
178syn match nsisStatement		"${OrIfNot}"
179syn match nsisStatement		"${OrUnless}"
180syn match nsisStatement		"${IfThen}"
181syn match nsisStatement		"${IfNotThen}"
182syn match nsisStatement		"${||\?}" nextgroup=@nsisPseudoStatement skipwhite
183syn match nsisStatement		"${IfCmd}" nextgroup=@nsisPseudoStatement skipwhite
184syn match nsisStatement		"${Select}"
185syn match nsisStatement		"${Case}"
186syn match nsisStatement		"${Case[2-5]}"
187syn match nsisStatement		"${CaseElse}"
188syn match nsisStatement		"${Default}"
189syn match nsisStatement		"${EndSelect}"
190syn match nsisStatement		"${Switch}"
191syn match nsisStatement		"${EndSwitch}"
192syn match nsisStatement		"${Break}"
193syn match nsisStatement		"${Do}"
194syn match nsisStatement		"${DoWhile}"
195syn match nsisStatement		"${DoUntil}"
196syn match nsisStatement		"${ExitDo}"
197syn match nsisStatement		"${Continue}"
198syn match nsisStatement		"${Loop}"
199syn match nsisStatement		"${LoopWhile}"
200syn match nsisStatement		"${LoopUntil}"
201syn match nsisStatement		"${For}"
202syn match nsisStatement		"${ForEach}"
203syn match nsisStatement		"${ExitFor}"
204syn match nsisStatement		"${Next}"
205"STATEMENTS - Memento.nsh
206syn match nsisStatement		"${MementoSection}"
207syn match nsisStatement		"${MementoSectionEnd}"
208
209
210"USER VARIABLES (4.2.1)
211syn keyword nsisInstruction	contained Var nextgroup=nsisVarOpt skipwhite
212syn region nsisVarOpt		contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisVarKwd
213syn match nsisVarKwd		contained "/GLOBAL\>"
214
215"INSTALLER ATTRIBUTES (4.8.1)
216syn keyword nsisAttribute	contained Caption ChangeUI CheckBitmap CompletedText ComponentText
217syn keyword nsisAttribute	contained DetailsButtonText DirText DirVar
218syn keyword nsisAttribute	contained FileErrorText Icon InstallButtonText
219syn keyword nsisAttribute	contained InstallDir InstProgressFlags
220syn keyword nsisAttribute	contained LicenseData LicenseText
221syn keyword nsisAttribute	contained MiscButtonText Name OutFile
222syn keyword nsisAttribute	contained SpaceTexts SubCaption UninstallButtonText UninstallCaption
223syn keyword nsisAttribute	contained UninstallIcon UninstallSubCaption UninstallText
224
225syn keyword nsisAttribute	contained AddBrandingImage nextgroup=nsisAddBrandingImageOpt skipwhite
226syn region nsisAddBrandingImageOpt  contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisAddBrandingImageKwd
227syn keyword nsisAddBrandingImageKwd contained left right top bottom width height
228
229syn keyword nsisAttribute	contained nextgroup=nsisBooleanOpt skipwhite
230			\ AllowRootDirInstall AutoCloseWindow
231
232syn keyword nsisAttribute	contained BGFont nextgroup=nsisFontOpt skipwhite
233
234syn keyword nsisAttribute	contained BGGradient nextgroup=nsisBGGradientOpt skipwhite
235syn region nsisBGGradientOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisBGGradientKwd
236syn keyword nsisBGGradientKwd	contained off
237
238syn keyword nsisAttribute	contained BrandingText nextgroup=nsisBrandingTextOpt skipwhite
239syn region nsisBrandingTextOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisBrandingTextKwd
240syn match nsisBrandingTextKwd	contained "/TRIM\%(LEFT\|RIGHT\|CENTER\)\>"
241
242syn keyword nsisAttribute	contained CRCCheck nextgroup=nsisCRCCheckOpt skipwhite
243syn region nsisCRCCheckOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisCRCCheckKwd
244syn keyword nsisCRCCheckKwd	contained on off force
245
246syn keyword nsisAttribute	contained DirVerify nextgroup=nsisDirVerifyOpt skipwhite
247syn region nsisDirVerifyOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisDirVerifyKwd
248syn keyword nsisDirVerifyKwd	contained auto leave
249
250syn keyword nsisAttribute	contained InstallColors nextgroup=nsisInstallColorsOpt skipwhite
251syn region nsisInstallColorsOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisInstallColorsKwd
252syn match nsisInstallColorsKwd	contained "/windows\>"
253
254syn keyword nsisAttribute	contained InstallDirRegKey nextgroup=nsisRegistryOpt skipwhite
255
256syn keyword nsisAttribute	contained InstType nextgroup=nsisInstTypeOpt skipwhite
257syn region nsisInstTypeOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisInstTypeKwd
258syn match nsisInstTypeKwd	contained "/\%(NOCUSTOM\|CUSTOMSTRING\|COMPONENTSONLYONCUSTOM\)\>"
259
260syn keyword nsisAttribute	contained LicenseBkColor nextgroup=nsisLicenseBkColorOpt skipwhite
261syn region nsisLicenseBkColorOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisLicenseBkColorKwd
262syn match nsisLicenseBkColorKwd  contained "/\%(gray\|windows\)\>"
263
264syn keyword nsisAttribute	contained LicenseForceSelection nextgroup=nsisLicenseForceSelectionOpt skipwhite
265syn region nsisLicenseForceSelectionOpt  contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisLicenseForceSelectionKwd
266syn keyword nsisLicenseForceSelectionKwd contained checkbox radiobuttons off
267
268syn keyword nsisAttribute	contained ManifestDPIAware nextgroup=nsisManifestDPIAwareOpt skipwhite
269syn region nsisManifestDPIAwareOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisManifestDPIAwareKwd
270syn keyword nsisManifestDPIAwareKwd	contained notset true false
271
272syn keyword nsisAttribute	contained ManifestSupportedOS nextgroup=nsisManifestSupportedOSOpt skipwhite
273syn region nsisManifestSupportedOSOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisManifestSupportedOSKwd
274syn match nsisManifestSupportedOSKwd	contained "\<\%(none\|all\|WinVista\|Win7\|Win8\|Win8\.1\|Win10\)\>"
275
276syn keyword nsisAttribute	contained RequestExecutionLevel nextgroup=nsisRequestExecutionLevelOpt skipwhite
277syn region nsisRequestExecutionLevelOpt  contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisRequestExecutionLevelKwd
278syn keyword nsisRequestExecutionLevelKwd contained none user highest admin
279
280syn keyword nsisAttribute	contained SetFont nextgroup=nsisLangOpt skipwhite
281
282syn keyword nsisAttribute	contained nextgroup=nsisShowInstDetailsOpt skipwhite
283			\ ShowInstDetails ShowUninstDetails
284syn region nsisShowInstDetailsOpt  contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisShowInstDetailsKwd
285syn keyword nsisShowInstDetailsKwd contained hide show nevershow
286
287syn keyword nsisAttribute	contained SilentInstall nextgroup=nsisSilentInstallOpt skipwhite
288syn region nsisSilentInstallOpt	 contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSilentInstallKwd
289syn keyword nsisSilentInstallKwd contained normal silent silentlog
290
291syn keyword nsisAttribute	contained SilentUnInstall nextgroup=nsisSilentUnInstallOpt skipwhite
292syn region nsisSilentUnInstallOpt  contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSilentUnInstallKwd
293syn keyword nsisSilentUnInstallKwd contained normal silent
294
295syn keyword nsisAttribute	contained nextgroup=nsisOnOffOpt skipwhite
296			\ WindowIcon XPStyle
297
298"COMPILER FLAGS (4.8.2)
299syn keyword nsisCompiler	contained nextgroup=nsisOnOffOpt skipwhite
300			\ AllowSkipFiles SetDatablockOptimize SetDateSave
301
302syn keyword nsisCompiler	contained FileBufSize SetCompressorDictSize
303
304syn keyword nsisCompiler	contained SetCompress nextgroup=nsisSetCompressOpt skipwhite
305syn region nsisSetCompressOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSetCompressKwd
306syn keyword nsisSetCompressKwd  contained auto force off
307
308syn keyword nsisCompiler	contained SetCompressor nextgroup=nsisSetCompressorOpt skipwhite
309syn region nsisSetCompressorOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSetCompressorKwd
310syn keyword nsisSetCompressorKwd  contained zlib bzip2 lzma
311syn match nsisSetCompressorKwd	contained "/\%(SOLID\|FINAL\)"
312
313syn keyword nsisCompiler	contained SetOverwrite nextgroup=nsisSetOverwriteOpt skipwhite
314syn region nsisSetOverwriteOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSetOverwriteKwd
315syn keyword nsisSetOverwriteKwd	contained on off try ifnewer ifdiff lastused
316
317syn keyword nsisCompiler	contained Unicode nextgroup=nsisBooleanOpt skipwhite
318
319"VERSION INFORMATION (4.8.3)
320syn keyword nsisVersionInfo	contained VIAddVersionKey nextgroup=nsisLangOpt skipwhite
321
322syn keyword nsisVersionInfo	contained VIProductVersion VIFileVersion
323
324
325"FUNCTIONS - basic (4.9.1)
326syn keyword nsisInstruction	contained Delete Rename nextgroup=nsisDeleteOpt skipwhite
327syn region nsisDeleteOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisDeleteKwd
328syn match nsisDeleteKwd		contained "/REBOOTOK\>"
329
330syn keyword nsisInstruction	contained Exec ExecWait SetOutPath
331
332syn keyword nsisInstruction	contained ExecShell ExecShellWait nextgroup=nsisExecShellOpt skipwhite
333syn region nsisExecShellOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisExecShellKwd
334syn keyword nsisExecShellKwd	contained SW_SHOWDEFAULT SW_SHOWNORMAL SW_SHOWMAXIMIZED SW_SHOWMINIMIZED SW_HIDE
335syn match nsisExecShellKwd	contained "/INVOKEIDLIST\>"
336
337syn keyword nsisInstruction	contained File nextgroup=nsisFileOpt skipwhite
338syn region nsisFileOpt		contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisFileKwd
339syn match nsisFileKwd		contained "/\%(nonfatal\|[arx]\|oname\)\>"
340
341syn keyword nsisInstruction	contained ReserveFile nextgroup=nsisReserveFileOpt skipwhite
342syn region nsisReserveFileOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisReserveFileKwd
343syn match nsisReserveFileKwd	contained "/\%(nonfatal\|[rx]\|plugin\)\>"
344
345syn keyword nsisInstruction	contained RMDir nextgroup=nsisRMDirOpt skipwhite
346syn region nsisRMDirOpt		contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisRMDirKwd
347syn match nsisRMDirKwd		contained "/\%(REBOOTOK\|r\)\>"
348
349
350"FUNCTIONS - registry & ini (4.9.2)
351syn keyword nsisInstruction	contained DeleteINISec DeleteINIStr FlushINI ReadINIStr WriteINIStr
352syn keyword nsisInstruction	contained ExpandEnvStrings ReadEnvStr
353
354syn keyword nsisInstruction	contained DeleteRegKey nextgroup=nsisDeleteRegKeyOpt skipwhite
355syn region nsisDeleteRegKeyOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisDeleteRegKeyKwd,nsisRegistry
356syn match nsisDeleteRegKeyKwd	contained "/ifempty\>"
357
358syn keyword nsisInstruction	contained nextgroup=nsisRegistryOpt skipwhite
359			\ DeleteRegValue EnumRegKey EnumRegValue ReadRegDWORD ReadRegStr WriteRegBin WriteRegDWORD WriteRegExpandStr WriteRegStr
360syn region nsisRegistryOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisRegistry
361
362syn keyword nsisInstruction	contained WriteRegMultiStr nextgroup=nsisWriteRegMultiStrOpt skipwhite
363syn region nsisWriteRegMultiStrOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisRegistry,nsisWriteRegMultiStrKwd
364syn match nsisWriteRegMultiStrKwd  contained "/REGEDIT5\>"
365
366syn keyword nsisInstruction	contained SetRegView nextgroup=nsisSetRegViewOpt skipwhite
367syn region nsisSetRegViewOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSetRegViewKwd
368syn keyword nsisSetRegViewKwd	contained default lastused
369
370"FUNCTIONS - general purpose (4.9.3)
371syn keyword nsisInstruction	contained CallInstDLL CreateDirectory GetDLLVersion
372syn keyword nsisInstruction	contained GetDLLVersionLocal GetFileTime GetFileTimeLocal
373syn keyword nsisInstruction	contained GetTempFileName SearchPath RegDLL UnRegDLL
374
375syn keyword nsisInstruction	contained CopyFiles nextgroup=nsisCopyFilesOpt skipwhite
376syn region nsisCopyFilesOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisCopyFilesKwd
377syn match nsisCopyFilesKwd	contained "/\%(SILENT\|FILESONLY\)\>"
378
379syn keyword nsisInstruction	contained CreateShortcut nextgroup=nsisCreateShortcutOpt skipwhite
380syn region nsisCreateShortcutOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisCreateShortcutKwd
381syn match nsisCreateShortcutKwd	 contained "/NoWorkingDir\>"
382
383syn keyword nsisInstruction	contained GetFullPathName nextgroup=nsisGetFullPathNameOpt skipwhite
384syn region nsisGetFullPathNameOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisGetFullPathNameKwd
385syn match nsisGetFullPathNameKwd  contained "/SHORT\>"
386
387syn keyword nsisInstruction	contained SetFileAttributes nextgroup=nsisSetFileAttributesOpt skipwhite
388syn region nsisSetFileAttributesOpt  contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisFileAttrib
389syn keyword nsisFileAttrib	contained NORMAL ARCHIVE HIDDEN OFFLINE READONLY SYSTEM TEMPORARY
390syn keyword nsisFileAttrib	contained FILE_ATTRIBUTE_NORMAL FILE_ATTRIBUTE_ARCHIVE FILE_ATTRIBUTE_HIDDEN
391syn keyword nsisFileAttrib	contained FILE_ATTRIBUTE_OFFLINE FILE_ATTRIBUTE_READONLY FILE_ATTRIBUTE_SYSTEM
392syn keyword nsisFileAttrib	contained FILE_ATTRIBUTE_TEMPORARY
393
394"FUNCTIONS - Flow Control (4.9.4)
395syn keyword nsisInstruction	contained Abort Call ClearErrors GetCurrentAddress
396syn keyword nsisInstruction	contained GetFunctionAddress GetLabelAddress Goto
397syn keyword nsisInstruction	contained IfAbort IfErrors IfFileExists IfRebootFlag IfSilent
398syn keyword nsisInstruction	contained IntCmp IntCmpU Return Quit SetErrors StrCmp StrCmpS
399
400syn keyword nsisInstruction	contained MessageBox nextgroup=nsisMessageBoxOpt skipwhite
401syn region nsisMessageBoxOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisMessageBox
402syn keyword nsisMessageBox	contained MB_OK MB_OKCANCEL MB_ABORTRETRYIGNORE MB_RETRYCANCEL MB_YESNO MB_YESNOCANCEL
403syn keyword nsisMessageBox	contained MB_ICONEXCLAMATION MB_ICONINFORMATION MB_ICONQUESTION MB_ICONSTOP MB_USERICON
404syn keyword nsisMessageBox	contained MB_TOPMOST MB_SETFOREGROUND MB_RIGHT MB_RTLREADING
405syn keyword nsisMessageBox	contained MB_DEFBUTTON1 MB_DEFBUTTON2 MB_DEFBUTTON3 MB_DEFBUTTON4
406syn keyword nsisMessageBox	contained IDABORT IDCANCEL IDIGNORE IDNO IDOK IDRETRY IDYES
407syn match nsisMessageBox	contained "/SD\>"
408
409"FUNCTIONS - File and directory i/o instructions (4.9.5)
410syn keyword nsisInstruction	contained FileClose FileOpen FileRead FileReadUTF16LE
411syn keyword nsisInstruction	contained FileReadByte FileReadWord FileSeek FileWrite
412syn keyword nsisInstruction	contained FileWriteByte FileWriteWord
413syn keyword nsisInstruction	contained FindClose FindFirst FindNext
414
415syn keyword nsisInstruction	contained FileWriteUTF16LE nextgroup=nsisFileWriteUTF16LEOpt skipwhite
416syn region nsisFileWriteUTF16LEOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisFileWriteUTF16LEKwd
417syn match nsisFileWriteUTF16LEKwd  contained "/BOM\>"
418
419"FUNCTIONS - Uninstaller instructions (4.9.6)
420syn keyword nsisInstruction	contained WriteUninstaller
421
422"FUNCTIONS - Misc instructions (4.9.7)
423syn keyword nsisInstruction	contained GetErrorLevel GetInstDirError InitPluginsDir Nop
424syn keyword nsisInstruction	contained SetErrorLevel Sleep
425
426syn keyword nsisInstruction	contained SetShellVarContext nextgroup=nsisSetShellVarContextOpt skipwhite
427syn region nsisSetShellVarContextOpt  contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSetShellVarContextKwd
428syn keyword nsisSetShellVarContextKwd contained current all
429
430"FUNCTIONS - String manipulation support (4.9.8)
431syn keyword nsisInstruction	contained StrCpy StrLen
432
433"FUNCTIONS - Stack support (4.9.9)
434syn keyword nsisInstruction	contained Exch Push Pop
435
436"FUNCTIONS - Integer manipulation support (4.9.10)
437syn keyword nsisInstruction	contained IntOp IntFmt
438
439"FUNCTIONS - Rebooting support (4.9.11)
440syn keyword nsisInstruction	contained Reboot SetRebootFlag
441
442"FUNCTIONS - Install logging instructions (4.9.12)
443syn keyword nsisInstruction	contained LogSet nextgroup=nsisOnOffOpt skipwhite
444syn keyword nsisInstruction	contained LogText
445
446"FUNCTIONS - Section management instructions (4.9.13)
447syn keyword nsisInstruction	contained SectionSetFlags SectionGetFlags SectionSetText
448syn keyword nsisInstruction	contained SectionGetText SectionSetInstTypes SectionGetInstTypes
449syn keyword nsisInstruction	contained SectionSetSize SectionGetSize SetCurInstType GetCurInstType
450syn keyword nsisInstruction	contained InstTypeSetText InstTypeGetText
451
452"FUNCTIONS - User Interface Instructions (4.9.14)
453syn keyword nsisInstruction	contained BringToFront DetailPrint EnableWindow
454syn keyword nsisInstruction	contained FindWindow GetDlgItem HideWindow IsWindow
455syn keyword nsisInstruction	contained ShowWindow
456
457syn keyword nsisInstruction	contained CreateFont nextgroup=nsisFontOpt skipwhite
458
459syn keyword nsisInstruction	contained nextgroup=nsisBooleanOpt skipwhite
460			\ LockWindow SetAutoClose
461
462syn keyword nsisInstruction	contained SendMessage nextgroup=nsisSendMessageOpt skipwhite
463syn region nsisSendMessageOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSendMessageKwd
464syn match nsisSendMessageKwd	contained "/TIMEOUT\>"
465
466syn keyword nsisInstruction	contained SetBrandingImage nextgroup=nsisSetBrandingImageOpt skipwhite
467syn region nsisSetBrandingImageOpt contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSetBrandingImageKwd
468syn match nsisSetBrandingImageKwd  contained "/\%(IMGID\|RESIZETOFIT\)\>"
469
470syn keyword nsisInstruction	contained SetDetailsView nextgroup=nsisSetDetailsViewOpt skipwhite
471syn region nsisSetDetailsViewOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSetDetailsViewKwd
472syn keyword nsisSetDetailsViewKwd	contained show hide
473
474syn keyword nsisInstruction	contained SetDetailsPrint nextgroup=nsisSetDetailsPrintOpt skipwhite
475syn region nsisSetDetailsPrintOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSetDetailsPrintKwd
476syn keyword nsisSetDetailsPrintKwd	contained none listonly textonly both lastused
477
478syn keyword nsisInstruction	contained SetCtlColors nextgroup=nsisSetCtlColorsOpt skipwhite
479syn region nsisSetCtlColorsOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSetCtlColorsKwd
480syn match nsisSetCtlColorsKwd	contained "/BRANDING\>"
481
482syn keyword nsisInstruction	contained SetSilent nextgroup=nsisSetSilentOpt skipwhite
483syn region nsisSetSilentOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSetSilentKwd
484syn keyword nsisSetSilentKwd	contained silent normal
485
486
487"FUNCTIONS - Multiple Languages Instructions (4.9.15)
488syn keyword nsisInstruction	contained LoadLanguageFile LangString LicenseLangString
489
490
491"SPECIAL FUNCTIONS - install (4.7.2.1)
492syn match nsisCallback		"\.onGUIInit"
493syn match nsisCallback		"\.onInit"
494syn match nsisCallback		"\.onInstFailed"
495syn match nsisCallback		"\.onInstSuccess"
496syn match nsisCallback		"\.onGUIEnd"
497syn match nsisCallback		"\.onMouseOverSection"
498syn match nsisCallback		"\.onRebootFailed"
499syn match nsisCallback		"\.onSelChange"
500syn match nsisCallback		"\.onUserAbort"
501syn match nsisCallback		"\.onVerifyInstDir"
502
503"SPECIAL FUNCTIONS - uninstall (4.7.2.2)
504syn match nsisCallback		"un\.onGUIInit"
505syn match nsisCallback		"un\.onInit"
506syn match nsisCallback		"un\.onUninstFailed"
507syn match nsisCallback		"un\.onUninstSuccess"
508syn match nsisCallback		"un\.onGUIEnd"
509syn match nsisCallback		"un\.onRebootFailed"
510syn match nsisCallback		"un\.onSelChange"
511syn match nsisCallback		"un\.onUserAbort"
512
513
514"COMPILER UTILITY (5.1)
515syn match nsisInclude		contained "!include\>" nextgroup=nsisIncludeOpt skipwhite
516syn region nsisIncludeOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisIncludeKwd
517syn match nsisIncludeKwd	contained "/\%(NONFATAL\|CHARSET\)\>"
518
519syn match nsisSystem		contained "!addincludedir\>"
520
521syn match nsisSystem		contained "!addplugindir\>" nextgroup=nsisAddplugindirOpt skipwhite
522syn region nsisAddplugindirOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisAddplugindirKwd
523syn match nsisAddplugindirKwd	contained "/\%(x86-ansi\|x86-unicode\)\>"
524
525syn match nsisSystem		contained "!appendfile\>" nextgroup=nsisAppendfileOpt skipwhite
526syn region nsisAppendfileOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisAppendfileKwd
527syn match nsisAppendfileKwd	contained "/\%(CHARSET\|RawNL\)\>"
528
529syn match nsisSystem		contained "!cd\>"
530
531syn match nsisSystem		contained "!delfile\>" nextgroup=nsisDelfileOpt skipwhite
532syn region nsisDelfileOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisDelfileKwd
533syn match nsisDelfileKwd	contained "/nonfatal\>"
534
535syn match nsisSystem		contained "!echo\>"
536syn match nsisSystem		contained "!error\>"
537syn match nsisSystem		contained "!execute\>"
538syn match nsisSystem		contained "!makensis\>"
539syn match nsisSystem		contained "!packhdr\>"
540syn match nsisSystem		contained "!finalize\>"
541syn match nsisSystem		contained "!system\>"
542syn match nsisSystem		contained "!tempfile\>"
543syn match nsisSystem		contained "!getdllversion\>"
544syn match nsisSystem		contained "!warning\>"
545
546syn match nsisSystem		contained "!pragma\>" nextgroup=nsisPragmaOpt skipwhite
547syn region nsisPragmaOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisPragmaKwd
548syn keyword nsisPragmaKwd	contained enable disable default push pop
549
550syn match nsisSystem		contained "!verbose\>" nextgroup=nsisVerboseOpt skipwhite
551syn region nsisVerboseOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisVerboseKwd
552syn keyword nsisVerboseKwd	contained push pop
553
554"PREPROCESSOR (5.4)
555syn match nsisDefine		contained "!define\>" nextgroup=nsisDefineOpt skipwhite
556syn region nsisDefineOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisDefineKwd
557syn match nsisDefineKwd		contained "/\%(ifndef\|redef\|date\|utcdate\|math\|file\)\>"
558
559syn match nsisDefine		contained "!undef\>"
560syn match nsisPreCondit		contained "!ifdef\>"
561syn match nsisPreCondit		contained "!ifndef\>"
562
563syn match nsisPreCondit		contained "!if\>" nextgroup=nsisIfOpt skipwhite
564syn region nsisIfOpt		contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisIfKwd
565syn match nsisIfKwd		contained "/FileExists\>"
566
567syn match nsisPreCondit		contained "!ifmacrodef\>"
568syn match nsisPreCondit		contained "!ifmacrondef\>"
569syn match nsisPreCondit		contained "!else\>"
570syn match nsisPreCondit		contained "!endif\>"
571syn match nsisMacro		contained "!insertmacro\>"
572syn match nsisMacro		contained "!macro\>"
573syn match nsisMacro		contained "!macroend\>"
574syn match nsisMacro		contained "!macroundef\>"
575
576syn match nsisMacro		contained "!searchparse\>" nextgroup=nsisSearchparseOpt skipwhite
577syn region nsisSearchparseOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSearchparseKwd
578syn match nsisSearchparseKwd	contained "/\%(ignorecase\|noerrors\|file\)\>"
579
580syn match nsisMacro		contained "!searchreplace\>" nextgroup=nsisSearchreplaceOpt skipwhite
581syn region nsisSearchreplaceOpt	contained start="" end="$" transparent keepend contains=@nsisAnyOpt,nsisSearchreplaceKwd
582syn match nsisSearchreplaceKwd	contained "/ignorecase\>"
583
584
585
586" Define the default highlighting.
587" Only when an item doesn't have highlighting yet
588
589hi def link nsisInstruction		Function
590hi def link nsisComment			Comment
591hi def link nsisFirstComment		Comment
592hi def link nsisLocalLabel		Label
593hi def link nsisGlobalLabel		Label
594hi def link nsisStatement		Statement
595hi def link nsisString			String
596hi def link nsisBoolean			Boolean
597hi def link nsisOnOff			Boolean
598hi def link nsisFontKwd			Constant
599hi def link nsisLangKwd			Constant
600hi def link nsisPageKwd			Constant
601hi def link nsisPageExKwd		Constant
602hi def link nsisSectionKwd		Constant
603hi def link nsisSectionInKwd		Constant
604hi def link nsisSectionGroupKwd		Constant
605hi def link nsisVarKwd			Constant
606hi def link nsisAddBrandingImageKwd	Constant
607hi def link nsisBGGradientKwd		Constant
608hi def link nsisBrandingTextKwd		Constant
609hi def link nsisCRCCheckKwd		Constant
610hi def link nsisDirVerifyKwd		Constant
611hi def link nsisInstallColorsKwd	Constant
612hi def link nsisInstTypeKwd		Constant
613hi def link nsisLicenseBkColorKwd	Constant
614hi def link nsisLicenseForceSelectionKwd Constant
615hi def link nsisManifestDPIAwareKwd	Constant
616hi def link nsisManifestSupportedOSKwd	Constant
617hi def link nsisRequestExecutionLevelKwd Constant
618hi def link nsisShowInstDetailsKwd	Constant
619hi def link nsisSilentInstallKwd	Constant
620hi def link nsisSilentUnInstallKwd	Constant
621hi def link nsisSetCompressKwd		Constant
622hi def link nsisSetCompressorKwd	Constant
623hi def link nsisSetOverwriteKwd		Constant
624hi def link nsisDeleteKwd		Constant
625hi def link nsisExecShellKwd		Constant
626hi def link nsisFileKwd			Constant
627hi def link nsisReserveFileKwd		Constant
628hi def link nsisRMDirKwd		Constant
629hi def link nsisDeleteRegKeyKwd		Constant
630hi def link nsisWriteRegMultiStrKwd	Constant
631hi def link nsisSetRegViewKwd		Constant
632hi def link nsisCopyFilesKwd		Constant
633hi def link nsisCreateShortcutKwd	Constant
634hi def link nsisGetFullPathNameKwd	Constant
635hi def link nsisFileAttrib		Constant
636hi def link nsisMessageBox		Constant
637hi def link nsisFileWriteUTF16LEKwd	Constant
638hi def link nsisSetShellVarContextKwd	Constant
639hi def link nsisSendMessageKwd		Constant
640hi def link nsisSetBrandingImageKwd	Constant
641hi def link nsisSetDetailsViewKwd	Constant
642hi def link nsisSetDetailsPrintKwd	Constant
643hi def link nsisSetCtlColorsKwd		Constant
644hi def link nsisSetSilentKwd		Constant
645hi def link nsisRegistry		Identifier
646hi def link nsisNumber			Number
647hi def link nsisError			Error
648hi def link nsisUserVar			Identifier
649hi def link nsisSysVar			Identifier
650hi def link nsisAttribute		Type
651hi def link nsisCompiler		Type
652hi def link nsisVersionInfo		Type
653hi def link nsisTodo			Todo
654hi def link nsisCallback		Identifier
655" preprocessor commands
656hi def link nsisPreprocSubst		PreProc
657hi def link nsisPreprocLangStr		PreProc
658hi def link nsisPreprocEnvVar		PreProc
659hi def link nsisDefine			Define
660hi def link nsisMacro			Macro
661hi def link nsisPreCondit		PreCondit
662hi def link nsisInclude			Include
663hi def link nsisSystem			PreProc
664hi def link nsisLineContinuation	Special
665hi def link nsisIncludeKwd		Constant
666hi def link nsisAddplugindirKwd		Constant
667hi def link nsisAppendfileKwd		Constant
668hi def link nsisDelfileKwd		Constant
669hi def link nsisPragmaKwd		Constant
670hi def link nsisVerboseKwd		Constant
671hi def link nsisDefineKwd		Constant
672hi def link nsisIfKwd			Constant
673hi def link nsisSearchparseKwd		Constant
674hi def link nsisSearchreplaceKwd	Constant
675
676
677let b:current_syntax = "nsis"
678
679let &cpo = s:cpo_save
680unlet s:cpo_save
681