home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / unix / vim-6.2.tar.bz2 / vim-6.2.tar / vim62 / runtime / syntax / nsis.vim < prev    next >
Encoding:
Text File  |  2002-07-25  |  9.5 KB  |  268 lines

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