Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / share / vim / vim58 / syntax / registry.vim
blobb963e158b1b81a6e31d6ec89af3b119501ae6a51
1 " Vim syntax file
2 " Language:     Windows Registry export with regedit (*.reg)
3 " Maintainer:   Dominique Stéphan (stephan@my-deja.com)
4 " URL: http://www.mggen.com/vim/syntax/registry.zip
5 " Last change:  2001 May 10
7 " clear any unwanted syntax defs
8 " For version 5.x: Clear all syntax items
9 " For version 6.x: Quit when a syntax file was already loaded
10 if version < 600
11   syntax clear
12 elseif exists("b:current_syntax")
13   finish
14 endif
16 " shut case off
17 syn case ignore
19 " Head of regedit .reg files, it's REGEDIT4 on Win9#/NT
20 syn match registryHead          "^REGEDIT[0-9]*$"
22 " Comment
23 syn match  registryComment      "^;.*$"
25 " Registry Key constant
26 syn keyword registryHKEY        HKEY_LOCAL_MACHINE HKEY_CLASSES_ROOT HKEY_CURRENT_USER
27 syn keyword registryHKEY        HKEY_USERS HKEY_CURRENT_CONFIG HKEY_DYN_DATA
28 " Registry Key shortcuts
29 syn keyword registryHKEY        HKLM HKCR HKCU HKU HKCC HKDD
31 " Some values often found in the registry
32 " GUID (Global Unique IDentifier)
33 syn match   registryGUID        "{[0-9A-Fa-f]\{8}\-[0-9A-Fa-f]\{4}\-[0-9A-Fa-f]\{4}\-[0-9A-Fa-f]\{4}\-[0-9A-Fa-f]\{12}}" contains=registrySpecial
35 " Disk
36 " syn match   registryDisk      "[a-zA-Z]:\\\\"
38 " Special and Separator characters
39 syn match   registrySpecial     "\\"
40 syn match   registrySpecial     "\\\\"
41 syn match   registrySpecial     "\\\""
42 syn match   registrySpecial     "\."
43 syn match   registrySpecial     ","
44 syn match   registrySpecial     "\/"
45 syn match   registrySpecial     ":"
46 syn match   registrySpecial     "-"
48 " String
49 syn match   registryString      "\".*\"" contains=registryGUID,registrySpecial
51 " Path
52 syn region  registryPath                start="\[" end="\]" contains=registryHKEY,registryGUID,registrySpecial
54 " Path to remove
55 " like preceding path but with a "-" at begin
56 syn region registryRemove       start="\[\-" end="\]" contains=registryHKEY,registryGUID,registrySpecial
58 " Subkey
59 syn match  registrySubKey               "^\".*\"="
60 " Default value
61 syn match  registrySubKey               "^\@="
63 " Numbers
65 " Hex or Binary
66 " The format can be precised between () :
67 " 0    REG_NONE
68 " 1    REG_SZ
69 " 2    REG_EXPAND_SZ
70 " 3    REG_BINARY
71 " 4    REG_DWORD, REG_DWORD_LITTLE_ENDIAN
72 " 5    REG_DWORD_BIG_ENDIAN
73 " 6    REG_LINK
74 " 7    REG_MULTI_SZ
75 " 8    REG_RESOURCE_LIST
76 " 9    REG_FULL_RESOURCE_DESCRIPTOR
77 " 10   REG_RESOURCE_REQUIREMENTS_LIST
78 " The value can take several lines, if \ ends the line
79 syn match registryHex           "hex\(([0-9]\{0,2})\)\=:\([0-9a-fA-F]\{2},\)*\([0-9a-fA-F]\{2}\|\\\)$" contains=registrySpecial
80 syn match registryHex           "^\s*\([0-9a-fA-F]\{2},\)*\([0-9a-fA-F]\{2}\|\\\)$" contains=registrySpecial
81 " Dword (32 bits)
82 syn match registryDword         "dword:[0-9a-fA-F]\{8}$" contains=registrySpecial
84 if version >= 508 || !exists("did_registry_syntax_inits")
85   if version < 508
86     let did_registry_syntax_inits = 1
87     command -nargs=+ HiLink hi link <args>
88   else
89     command -nargs=+ HiLink hi def link <args>
90   endif
92 " The default methods for highlighting.  Can be overridden later
93    HiLink registryComment       Comment
94    HiLink registryHead          Constant
95    HiLink registryHKEY          Constant
96    HiLink registryPath          Special
97    HiLink registryRemove        PreProc
98    HiLink registryGUID          Identifier
99    HiLink registrySpecial       Special
100    HiLink registrySubKey        Type
101    HiLink registryString        String
102    HiLink registryHex           Number
103    HiLink registryDword         Number
105    delcommand HiLink
106 endif
109 let b:current_syntax = "registry"
111 " vim:ts=8