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