Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: NSIS script, for version of NSIS 1.91 and later |
| 3 | " Maintainer: Alex Jakushev <Alex.Jakushev@kemek.lt> |
| 4 | " Last Change: 2004 May 12 |
| 5 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 6 | " quit when a syntax file was already loaded |
| 7 | if exists("b:current_syntax") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8 | finish |
| 9 | endif |
| 10 | |
| 11 | syn case ignore |
| 12 | |
| 13 | |
| 14 | "COMMENTS |
| 15 | syn keyword nsisTodo todo attention note fixme readme |
| 16 | syn region nsisComment start=";" end="$" contains=nsisTodo |
| 17 | syn region nsisComment start="#" end="$" contains=nsisTodo |
| 18 | |
| 19 | "LABELS |
| 20 | syn match nsisLocalLabel "\a\S\{-}:" |
| 21 | syn match nsisGlobalLabel "\.\S\{-1,}:" |
| 22 | |
| 23 | "PREPROCESSOR |
| 24 | syn match nsisPreprocSubst "${.\{-}}" |
| 25 | syn match nsisDefine "!define\>" |
| 26 | syn match nsisDefine "!undef\>" |
| 27 | syn match nsisPreCondit "!ifdef\>" |
| 28 | syn match nsisPreCondit "!ifndef\>" |
| 29 | syn match nsisPreCondit "!endif\>" |
| 30 | syn match nsisPreCondit "!else\>" |
| 31 | syn match nsisMacro "!macro\>" |
| 32 | syn match nsisMacro "!macroend\>" |
| 33 | syn match nsisMacro "!insertmacro\>" |
| 34 | |
| 35 | "COMPILER UTILITY |
| 36 | syn match nsisInclude "!include\>" |
| 37 | syn match nsisSystem "!cd\>" |
| 38 | syn match nsisSystem "!system\>" |
| 39 | syn match nsisSystem "!packhdr\>" |
| 40 | |
| 41 | "VARIABLES |
| 42 | syn match nsisUserVar "$\d" |
| 43 | syn match nsisUserVar "$R\d" |
| 44 | syn match nsisSysVar "$INSTDIR" |
| 45 | syn match nsisSysVar "$OUTDIR" |
| 46 | syn match nsisSysVar "$CMDLINE" |
| 47 | syn match nsisSysVar "$PROGRAMFILES" |
| 48 | syn match nsisSysVar "$DESKTOP" |
| 49 | syn match nsisSysVar "$EXEDIR" |
| 50 | syn match nsisSysVar "$WINDIR" |
| 51 | syn match nsisSysVar "$SYSDIR" |
| 52 | syn match nsisSysVar "$TEMP" |
| 53 | syn match nsisSysVar "$STARTMENU" |
| 54 | syn match nsisSysVar "$SMPROGRAMS" |
| 55 | syn match nsisSysVar "$SMSTARTUP" |
| 56 | syn match nsisSysVar "$QUICKLAUNCH" |
| 57 | syn match nsisSysVar "$HWNDPARENT" |
| 58 | syn match nsisSysVar "$\\r" |
| 59 | syn match nsisSysVar "$\\n" |
| 60 | syn match nsisSysVar "$\$" |
| 61 | |
| 62 | "STRINGS |
| 63 | syn region nsisString start=/"/ skip=/'\|`/ end=/"/ contains=nsisPreprocSubst,nsisUserVar,nsisSysVar,nsisRegistry |
| 64 | syn region nsisString start=/'/ skip=/"\|`/ end=/'/ contains=nsisPreprocSubst,nsisUserVar,nsisSysVar,nsisRegistry |
| 65 | syn region nsisString start=/`/ skip=/"\|'/ end=/`/ contains=nsisPreprocSubst,nsisUserVar,nsisSysVar,nsisRegistry |
| 66 | |
| 67 | "CONSTANTS |
| 68 | syn keyword nsisBoolean true false on off |
| 69 | |
| 70 | syn keyword nsisAttribOptions hide show nevershow auto force try ifnewer normal silent silentlog |
| 71 | syn keyword nsisAttribOptions smooth colored SET CUR END RO none listonly textonly both current all |
| 72 | syn keyword nsisAttribOptions zlib bzip2 lzma |
| 73 | |
| 74 | syn match nsisAttribOptions '\/NOCUSTOM' |
| 75 | syn match nsisAttribOptions '\/CUSTOMSTRING' |
| 76 | syn match nsisAttribOptions '\/COMPONENTSONLYONCUSTOM' |
| 77 | syn match nsisAttribOptions '\/windows' |
| 78 | syn match nsisAttribOptions '\/r' |
| 79 | syn match nsisAttribOptions '\/oname' |
| 80 | syn match nsisAttribOptions '\/REBOOTOK' |
| 81 | syn match nsisAttribOptions '\/SILENT' |
| 82 | syn match nsisAttribOptions '\/FILESONLY' |
| 83 | syn match nsisAttribOptions '\/SHORT' |
| 84 | |
| 85 | syn keyword nsisExecShell SW_SHOWNORMAL SW_SHOWMAXIMIZED SW_SHOWMINIMIZED |
| 86 | |
| 87 | syn keyword nsisRegistry HKCR HKLM HKCU HKU HKCC HKDD HKPD |
| 88 | syn keyword nsisRegistry HKEY_CLASSES_ROOT HKEY_LOCAL_MACHINE HKEY_CURRENT_USER HKEY_USERS |
| 89 | syn keyword nsisRegistry HKEY_CURRENT_CONFIG HKEY_DYN_DATA HKEY_PERFORMANCE_DATA |
| 90 | |
| 91 | syn keyword nsisFileAttrib NORMAL ARCHIVE HIDDEN OFFLINE READONLY SYSTEM TEMPORARY |
| 92 | syn keyword nsisFileAttrib FILE_ATTRIBUTE_NORMAL FILE_ATTRIBUTE_ARCHIVE FILE_ATTRIBUTE_HIDDEN |
| 93 | syn keyword nsisFileAttrib FILE_ATTRIBUTE_OFFLINE FILE_ATTRIBUTE_READONLY FILE_ATTRIBUTE_SYSTEM |
| 94 | syn keyword nsisFileAttrib FILE_ATTRIBUTE_TEMPORARY |
| 95 | |
| 96 | syn keyword nsisMessageBox MB_OK MB_OKCANCEL MB_ABORTRETRYIGNORE MB_RETRYCANCEL MB_YESNO MB_YESNOCANCEL |
| 97 | syn keyword nsisMessageBox MB_ICONEXCLAMATION MB_ICONINFORMATION MB_ICONQUESTION MB_ICONSTOP |
| 98 | syn keyword nsisMessageBox MB_TOPMOST MB_SETFOREGROUND MB_RIGHT |
| 99 | syn keyword nsisMessageBox MB_DEFBUTTON1 MB_DEFBUTTON2 MB_DEFBUTTON3 MB_DEFBUTTON4 |
| 100 | syn keyword nsisMessageBox IDABORT IDCANCEL IDIGNORE IDNO IDOK IDRETRY IDYES |
| 101 | |
| 102 | syn match nsisNumber "\<[^0]\d*\>" |
| 103 | syn match nsisNumber "\<0x\x\+\>" |
| 104 | syn match nsisNumber "\<0\o*\>" |
| 105 | |
| 106 | |
| 107 | "INSTALLER ATTRIBUTES - General installer configuration |
| 108 | syn keyword nsisAttribute OutFile Name Caption SubCaption BrandingText Icon |
| 109 | syn keyword nsisAttribute WindowIcon BGGradient SilentInstall SilentUnInstall |
| 110 | syn keyword nsisAttribute CRCCheck MiscButtonText InstallButtonText FileErrorText |
| 111 | |
| 112 | "INSTALLER ATTRIBUTES - Install directory configuration |
| 113 | syn keyword nsisAttribute InstallDir InstallDirRegKey |
| 114 | |
| 115 | "INSTALLER ATTRIBUTES - License page configuration |
| 116 | syn keyword nsisAttribute LicenseText LicenseData |
| 117 | |
| 118 | "INSTALLER ATTRIBUTES - Component page configuration |
| 119 | syn keyword nsisAttribute ComponentText InstType EnabledBitmap DisabledBitmap SpaceTexts |
| 120 | |
| 121 | "INSTALLER ATTRIBUTES - Directory page configuration |
| 122 | syn keyword nsisAttribute DirShow DirText AllowRootDirInstall |
| 123 | |
| 124 | "INSTALLER ATTRIBUTES - Install page configuration |
| 125 | syn keyword nsisAttribute InstallColors InstProgressFlags AutoCloseWindow |
| 126 | syn keyword nsisAttribute ShowInstDetails DetailsButtonText CompletedText |
| 127 | |
| 128 | "INSTALLER ATTRIBUTES - Uninstall configuration |
| 129 | syn keyword nsisAttribute UninstallText UninstallIcon UninstallCaption |
| 130 | syn keyword nsisAttribute UninstallSubCaption ShowUninstDetails UninstallButtonText |
| 131 | |
| 132 | "COMPILER ATTRIBUTES |
| 133 | syn keyword nsisCompiler SetOverwrite SetCompress SetCompressor SetDatablockOptimize SetDateSave |
| 134 | |
| 135 | |
| 136 | "FUNCTIONS - general purpose |
| 137 | syn keyword nsisInstruction SetOutPath File Exec ExecWait ExecShell |
| 138 | syn keyword nsisInstruction Rename Delete RMDir |
| 139 | |
| 140 | "FUNCTIONS - registry & ini |
| 141 | syn keyword nsisInstruction WriteRegStr WriteRegExpandStr WriteRegDWORD WriteRegBin |
| 142 | syn keyword nsisInstruction WriteINIStr ReadRegStr ReadRegDWORD ReadINIStr ReadEnvStr |
| 143 | syn keyword nsisInstruction ExpandEnvStrings DeleteRegValue DeleteRegKey EnumRegKey |
| 144 | syn keyword nsisInstruction EnumRegValue DeleteINISec DeleteINIStr |
| 145 | |
| 146 | "FUNCTIONS - general purpose, advanced |
| 147 | syn keyword nsisInstruction CreateDirectory CopyFiles SetFileAttributes CreateShortCut |
| 148 | syn keyword nsisInstruction GetFullPathName SearchPath GetTempFileName CallInstDLL |
| 149 | syn keyword nsisInstruction RegDLL UnRegDLL GetDLLVersion GetDLLVersionLocal |
| 150 | syn keyword nsisInstruction GetFileTime GetFileTimeLocal |
| 151 | |
| 152 | "FUNCTIONS - Branching, flow control, error checking, user interaction, etc instructions |
| 153 | syn keyword nsisInstruction Goto Call Return IfErrors ClearErrors SetErrors FindWindow |
| 154 | syn keyword nsisInstruction SendMessage IsWindow IfFileExists MessageBox StrCmp |
| 155 | syn keyword nsisInstruction IntCmp IntCmpU Abort Quit GetFunctionAddress GetLabelAddress |
| 156 | syn keyword nsisInstruction GetCurrentAddress |
| 157 | |
| 158 | "FUNCTIONS - File and directory i/o instructions |
| 159 | syn keyword nsisInstruction FindFirst FindNext FindClose FileOpen FileClose FileRead |
| 160 | syn keyword nsisInstruction FileWrite FileReadByte FileWriteByte FileSeek |
| 161 | |
| 162 | "FUNCTIONS - Misc instructions |
| 163 | syn keyword nsisInstruction SetDetailsView SetDetailsPrint SetAutoClose DetailPrint |
| 164 | syn keyword nsisInstruction Sleep BringToFront HideWindow SetShellVarContext |
| 165 | |
| 166 | "FUNCTIONS - String manipulation support |
| 167 | syn keyword nsisInstruction StrCpy StrLen |
| 168 | |
| 169 | "FUNCTIONS - Stack support |
| 170 | syn keyword nsisInstruction Push Pop Exch |
| 171 | |
| 172 | "FUNCTIONS - Integer manipulation support |
| 173 | syn keyword nsisInstruction IntOp IntFmt |
| 174 | |
| 175 | "FUNCTIONS - Rebooting support |
| 176 | syn keyword nsisInstruction Reboot IfRebootFlag SetRebootFlag |
| 177 | |
| 178 | "FUNCTIONS - Uninstaller instructions |
| 179 | syn keyword nsisInstruction WriteUninstaller |
| 180 | |
| 181 | "FUNCTIONS - Install logging instructions |
| 182 | syn keyword nsisInstruction LogSet LogText |
| 183 | |
| 184 | "FUNCTIONS - Section management instructions |
| 185 | syn keyword nsisInstruction SectionSetFlags SectionGetFlags SectionSetText |
| 186 | syn keyword nsisInstruction SectionGetText |
| 187 | |
| 188 | |
| 189 | "SPECIAL FUNCTIONS - install |
| 190 | syn match nsisCallback "\.onInit" |
| 191 | syn match nsisCallback "\.onUserAbort" |
| 192 | syn match nsisCallback "\.onInstSuccess" |
| 193 | syn match nsisCallback "\.onInstFailed" |
| 194 | syn match nsisCallback "\.onVerifyInstDir" |
| 195 | syn match nsisCallback "\.onNextPage" |
| 196 | syn match nsisCallback "\.onPrevPage" |
| 197 | syn match nsisCallback "\.onSelChange" |
| 198 | |
| 199 | "SPECIAL FUNCTIONS - uninstall |
| 200 | syn match nsisCallback "un\.onInit" |
| 201 | syn match nsisCallback "un\.onUserAbort" |
| 202 | syn match nsisCallback "un\.onInstSuccess" |
| 203 | syn match nsisCallback "un\.onInstFailed" |
| 204 | syn match nsisCallback "un\.onVerifyInstDir" |
| 205 | syn match nsisCallback "un\.onNextPage" |
| 206 | |
| 207 | |
| 208 | "STATEMENTS - sections |
| 209 | syn keyword nsisStatement Section SectionIn SectionEnd SectionDivider |
| 210 | syn keyword nsisStatement AddSize |
| 211 | |
| 212 | "STATEMENTS - functions |
| 213 | syn keyword nsisStatement Function FunctionEnd |
| 214 | |
| 215 | "STATEMENTS - pages |
| 216 | syn keyword nsisStatement Page UninstPage PageEx PageExEnc PageCallbacks |
| 217 | |
| 218 | |
| 219 | "ERROR |
| 220 | syn keyword nsisError UninstallExeName |
| 221 | |
| 222 | |
| 223 | " Define the default highlighting. |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 224 | " Only when an item doesn't have highlighting yet |
| 225 | command -nargs=+ HiLink hi def link <args> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 226 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 227 | HiLink nsisInstruction Function |
| 228 | HiLink nsisComment Comment |
| 229 | HiLink nsisLocalLabel Label |
| 230 | HiLink nsisGlobalLabel Label |
| 231 | HiLink nsisStatement Statement |
| 232 | HiLink nsisString String |
| 233 | HiLink nsisBoolean Boolean |
| 234 | HiLink nsisAttribOptions Constant |
| 235 | HiLink nsisExecShell Constant |
| 236 | HiLink nsisFileAttrib Constant |
| 237 | HiLink nsisMessageBox Constant |
| 238 | HiLink nsisRegistry Identifier |
| 239 | HiLink nsisNumber Number |
| 240 | HiLink nsisError Error |
| 241 | HiLink nsisUserVar Identifier |
| 242 | HiLink nsisSysVar Identifier |
| 243 | HiLink nsisAttribute Type |
| 244 | HiLink nsisCompiler Type |
| 245 | HiLink nsisTodo Todo |
| 246 | HiLink nsisCallback Operator |
| 247 | " preprocessor commands |
| 248 | HiLink nsisPreprocSubst PreProc |
| 249 | HiLink nsisDefine Define |
| 250 | HiLink nsisMacro Macro |
| 251 | HiLink nsisPreCondit PreCondit |
| 252 | HiLink nsisInclude Include |
| 253 | HiLink nsisSystem PreProc |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 254 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 255 | delcommand HiLink |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 256 | |
| 257 | let b:current_syntax = "nsis" |
| 258 | |