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