Skip to content

Commit 00df1f4

Browse files
committed
Import latest help.vim from Vim 8.0 (Issue #115)
1 parent 2840590 commit 00df1f4

File tree

3 files changed

+215
-8
lines changed

3 files changed

+215
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ html:
1414
cp -R syntax target/html
1515
cp doc/*.jax vim_faq/*.jax target/html/doc
1616
cp tools/buildhtml.vim tools/makehtml.vim target/html
17-
-cd target/html/doc ; vim -eu ../buildhtml.vim -c "qall!"
17+
-cd target/html/doc ; vim -c "set rtp^=../../../tools" -eu ../buildhtml.vim -c "qall!"
1818

1919
clean:
2020
rm -rf target

tools/makehtml.vim

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@
1717

1818
function! MakeHtmlAll()
1919
let s:log = []
20-
21-
" syntax hilight for `:foobar`
22-
syn match helpBacktick contained "`" conceal
23-
syn match helpCommand "`[^` \t]\+`"hs=s+1,he=e-1 contains=helpBacktick
24-
syn match helpCommand "\(^\|[^a-z"[]\)\zs`[^`]\+`\ze\([^a-z\t."']\|$\)"hs=s+1,he=e-1 contains=helpBacktick
25-
hi def link helpCommand Comment
26-
2720
call MakeTagsFile()
2821
echo ""
2922
let files = split(glob('*.??[tx]'), '\n')

tools/syntax/help.vim

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

0 commit comments

Comments
 (0)