1" Vim syntax file 2" Language: Vim help file 3" Maintainer: Bram Moolenaar ([email protected]) 4" Last Change: 2012 Jan 08 5 6" Quit when a (custom) syntax file was already loaded 7if exists("b:current_syntax") 8 finish 9endif 10 11let s:cpo_save = &cpo 12set cpo&vim 13 14syn match helpHeadline "^[-A-Z .][-A-Z0-9 .()]*[ \t]\+\*"me=e-1 15syn match helpSectionDelim "^=\{3,}.*===$" 16syn match helpSectionDelim "^-\{3,}.*--$" 17syn region helpExample matchgroup=helpIgnore start=" >$" start="^>$" end="^[^ \t]"me=e-1 end="^<" 18if has("ebcdic") 19 syn match helpHyperTextJump "\\\@<!|[^"*|]\+|" contains=helpBar 20 syn match helpHyperTextEntry "\*[^"*|]\+\*\s"he=e-1 contains=helpStar 21 syn match helpHyperTextEntry "\*[^"*|]\+\*$" contains=helpStar 22else 23 syn match helpHyperTextJump "\\\@<!|[#-)!+-~]\+|" contains=helpBar 24 syn match helpHyperTextEntry "\*[#-)!+-~]\+\*\s"he=e-1 contains=helpStar 25 syn match helpHyperTextEntry "\*[#-)!+-~]\+\*$" contains=helpStar 26endif 27if has("conceal") 28 syn match helpBar contained "|" conceal 29 syn match helpStar contained "\*" conceal 30else 31 syn match helpBar contained "|" 32 syn match helpStar contained "\*" 33endif 34syn match helpNormal "|.*====*|" 35syn match helpNormal "|||" 36syn match helpNormal ":|vim:|" " for :help modeline 37syn match helpVim "Vim version [0-9.a-z]\+" 38syn match helpVim "VIM REFERENCE.*" 39syn match helpOption "'[a-z]\{2,\}'" 40syn match helpOption "'t_..'" 41syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore 42syn match helpGraphic ".* \ze`$" nextgroup=helpIgnore 43if has("conceal") 44 syn match helpIgnore "." contained conceal 45else 46 syn match helpIgnore "." contained 47endif 48syn keyword helpNote note Note NOTE note: Note: NOTE: Notes Notes: 49syn match helpSpecial "\<N\>" 50syn match helpSpecial "\<N\.$"me=e-1 51syn match helpSpecial "\<N\.\s"me=e-2 52syn match helpSpecial "(N\>"ms=s+1 53syn match helpSpecial "\[N]" 54" avoid highlighting N N in help.txt 55syn match helpSpecial "N N"he=s+1 56syn match helpSpecial "Nth"me=e-2 57syn match helpSpecial "N-1"me=e-2 58syn match helpSpecial "{[-a-zA-Z0-9'":%#=[\]<>.,]\+}" 59syn match helpSpecial "{[-a-zA-Z0-9'"*+/:%#=[\]<>.,]\+}" 60syn match helpSpecial "\s\[[-a-z^A-Z0-9_]\{2,}]"ms=s+1 61syn match helpSpecial "<[-a-zA-Z0-9_]\+>" 62syn match helpSpecial "<[SCM]-.>" 63syn match helpNormal "<---*>" 64syn match helpSpecial "\[range]" 65syn match helpSpecial "\[line]" 66syn match helpSpecial "\[count]" 67syn match helpSpecial "\[offset]" 68syn match helpSpecial "\[cmd]" 69syn match helpSpecial "\[num]" 70syn match helpSpecial "\[+num]" 71syn match helpSpecial "\[-num]" 72syn match helpSpecial "\[+cmd]" 73syn match helpSpecial "\[++opt]" 74syn match helpSpecial "\[arg]" 75syn match helpSpecial "\[arguments]" 76syn match helpSpecial "\[ident]" 77syn match helpSpecial "\[addr]" 78syn match helpSpecial "\[group]" 79syn match helpSpecial "CTRL-." 80syn match helpSpecial "CTRL-Break" 81syn match helpSpecial "CTRL-PageUp" 82syn match helpSpecial "CTRL-PageDown" 83syn match helpSpecial "CTRL-Insert" 84syn match helpSpecial "CTRL-Del" 85syn match helpSpecial "CTRL-{char}" 86syn region helpNotVi start="{Vi[: ]" start="{not" start="{only" end="}" contains=helpLeadBlank,helpHyperTextJump 87syn match helpLeadBlank "^\s\+" contained 88 89" Highlight group items in their own color. 90syn match helpComment "\t[* ]Comment\t\+[a-z].*" 91syn match helpConstant "\t[* ]Constant\t\+[a-z].*" 92syn match helpString "\t[* ]String\t\+[a-z].*" 93syn match helpCharacter "\t[* ]Character\t\+[a-z].*" 94syn match helpNumber "\t[* ]Number\t\+[a-z].*" 95syn match helpBoolean "\t[* ]Boolean\t\+[a-z].*" 96syn match helpFloat "\t[* ]Float\t\+[a-z].*" 97syn match helpIdentifier "\t[* ]Identifier\t\+[a-z].*" 98syn match helpFunction "\t[* ]Function\t\+[a-z].*" 99syn match helpStatement "\t[* ]Statement\t\+[a-z].*" 100syn match helpConditional "\t[* ]Conditional\t\+[a-z].*" 101syn match helpRepeat "\t[* ]Repeat\t\+[a-z].*" 102syn match helpLabel "\t[* ]Label\t\+[a-z].*" 103syn match helpOperator "\t[* ]Operator\t\+["a-z].*" 104syn match helpKeyword "\t[* ]Keyword\t\+[a-z].*" 105syn match helpException "\t[* ]Exception\t\+[a-z].*" 106syn match helpPreProc "\t[* ]PreProc\t\+[a-z].*" 107syn match helpInclude "\t[* ]Include\t\+[a-z].*" 108syn match helpDefine "\t[* ]Define\t\+[a-z].*" 109syn match helpMacro "\t[* ]Macro\t\+[a-z].*" 110syn match helpPreCondit "\t[* ]PreCondit\t\+[a-z].*" 111syn match helpType "\t[* ]Type\t\+[a-z].*" 112syn match helpStorageClass "\t[* ]StorageClass\t\+[a-z].*" 113syn match helpStructure "\t[* ]Structure\t\+[a-z].*" 114syn match helpTypedef "\t[* ]Typedef\t\+[Aa-z].*" 115syn match helpSpecial "\t[* ]Special\t\+[a-z].*" 116syn match helpSpecialChar "\t[* ]SpecialChar\t\+[a-z].*" 117syn match helpTag "\t[* ]Tag\t\+[a-z].*" 118syn match helpDelimiter "\t[* ]Delimiter\t\+[a-z].*" 119syn match helpSpecialComment "\t[* ]SpecialComment\t\+[a-z].*" 120syn match helpDebug "\t[* ]Debug\t\+[a-z].*" 121syn match helpUnderlined "\t[* ]Underlined\t\+[a-z].*" 122syn match helpError "\t[* ]Error\t\+[a-z].*" 123syn match helpTodo "\t[* ]Todo\t\+[a-z].*" 124 125syn match helpURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-zA-Z0-9/]` 126 127" Additionally load a language-specific syntax file "help_ab.vim". 128let s:i = match(expand("%"), '\.\a\ax$') 129if s:i > 0 130 exe "runtime syntax/help_" . strpart(expand("%"), s:i + 1, 2) . ".vim" 131endif 132 133" Italian 134if v:lang =~ '\<IT\>' || v:lang =~ '_IT\>' || v:lang =~? "italian" 135 syn keyword helpNote nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE: 136 syn match helpSpecial "Nma"me=e-2 137 syn match helpSpecial "Nme"me=e-2 138 syn match helpSpecial "Nmi"me=e-2 139 syn match helpSpecial "Nmo"me=e-2 140 syn match helpSpecial "\[interv.]" 141 syn region helpNotVi start="{non" start="{solo" start="{disponibile" end="}" contains=helpLeadBlank,helpHyperTextJump 142endif 143 144syn sync minlines=40 145 146 147" Define the default highlighting. 148" Only used when an item doesn't have highlighting yet 149hi def link helpIgnore Ignore 150hi def link helpHyperTextJump Subtitle 151hi def link helpBar Ignore 152hi def link helpStar Ignore 153hi def link helpHyperTextEntry String 154hi def link helpHeadline Statement 155hi def link helpHeader PreProc 156hi def link helpSectionDelim PreProc 157hi def link helpVim Identifier 158hi def link helpExample Comment 159hi def link helpOption Type 160hi def link helpNotVi Special 161hi def link helpSpecial Special 162hi def link helpNote Todo 163hi def link Subtitle Identifier 164 165hi def link helpComment Comment 166hi def link helpConstant Constant 167hi def link helpString String 168hi def link helpCharacter Character 169hi def link helpNumber Number 170hi def link helpBoolean Boolean 171hi def link helpFloat Float 172hi def link helpIdentifier Identifier 173hi def link helpFunction Function 174hi def link helpStatement Statement 175hi def link helpConditional Conditional 176hi def link helpRepeat Repeat 177hi def link helpLabel Label 178hi def link helpOperator Operator 179hi def link helpKeyword Keyword 180hi def link helpException Exception 181hi def link helpPreProc PreProc 182hi def link helpInclude Include 183hi def link helpDefine Define 184hi def link helpMacro Macro 185hi def link helpPreCondit PreCondit 186hi def link helpType Type 187hi def link helpStorageClass StorageClass 188hi def link helpStructure Structure 189hi def link helpTypedef Typedef 190hi def link helpSpecialChar SpecialChar 191hi def link helpTag Tag 192hi def link helpDelimiter Delimiter 193hi def link helpSpecialComment SpecialComment 194hi def link helpDebug Debug 195hi def link helpUnderlined Underlined 196hi def link helpError Error 197hi def link helpTodo Todo 198hi def link helpURL String 199 200let b:current_syntax = "help" 201 202let &cpo = s:cpo_save 203unlet s:cpo_save 204" vim: ts=8 sw=2 205