2 " Language: Vim .viminfo file
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
4 " Last Change: 2001 Apr 25
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists("b:current_syntax")
14 " The lines that are NOT recognized
15 syn match viminfoError "^[^\t].*"
17 " The one-character one-liners that are recognized
18 syn match viminfoStatement "^[/&$@:?=%!<]"
20 " The two-character one-liners that are recognized
21 syn match viminfoStatement "^[-'>"]."
22 syn match viminfoStatement +^"".+
23 syn match viminfoStatement "^\~[/&]"
24 syn match viminfoStatement "^\~[hH]"
25 syn match viminfoStatement "^\~[mM][sS][lL][eE]\d\+\~\=[/&]"
27 syn match viminfoOption "^\*.*=" contains=viminfoOptionName
28 syn match viminfoOptionName "\*\a*"ms=s+1 contained
31 syn match viminfoComment "^#.*"
33 " Define the default highlighting.
34 " For version 5.7 and earlier: only when not done already
35 " For version 5.8 and later: only when an item doesn't have highlighting yet
36 if version >= 508 || !exists("did_viminfo_syntax_inits")
38 let did_viminfo_syntax_inits = 1
39 command -nargs=+ HiLink hi link <args>
41 command -nargs=+ HiLink hi def link <args>
44 HiLink viminfoComment Comment
45 HiLink viminfoError Error
46 HiLink viminfoStatement Statement
51 let b:current_syntax = "viminfo"