nsis.vim 33 KB

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