Skip to content

Commit 1c6f8b0

Browse files
lagygoilltechntools
authored andcommitted
runtime(doc): include a TOC Vim9 plugin
closes: vim#10446 See :h help-TOC Signed-off-by: lagygoill <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 5acaa51 commit 1c6f8b0

File tree

5 files changed

+1005
-2
lines changed

5 files changed

+1005
-2
lines changed

runtime/doc/helphelp.txt

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*helphelp.txt* For Vim version 9.1. Last change: 2024 Apr 10
1+
*helphelp.txt* For Vim version 9.1. Last change: 2024 Nov 02
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -246,6 +246,61 @@ command: >
246246
To rebuild the help tags in the runtime directory
247247
(requires write permission there): >
248248
:helptags $VIMRUNTIME/doc
249+
<
250+
*help-TOC* *help-toc-install*
251+
252+
If you want to access an interactive table of contents, from any position in
253+
the file, you can use the helptoc plugin. Load the plugin with: >
254+
255+
packadd helptoc
256+
257+
Then you can use the `:HelpToc` command to open a popup menu.
258+
The latter supports the following normal commands: >
259+
260+
key | effect
261+
----+---------------------------------------------------------
262+
j | select next entry
263+
k | select previous entry
264+
J | same as j, and jump to corresponding line in main buffer
265+
K | same as k, and jump to corresponding line in main buffer
266+
c | select nearest entry from cursor position in main buffer
267+
g | select first entry
268+
G | select last entry
269+
H | collapse one level
270+
L | expand one level
271+
p | print current entry on command-line
272+
273+
P | same as p but automatically, whenever selection changes
274+
| press multiple times to toggle feature on/off
275+
276+
q | quit menu
277+
z | redraw menu with current entry at center
278+
+ | increase width of popup menu
279+
- | decrease width of popup menu
280+
? | show/hide a help window
281+
282+
<C-D> | scroll down half a page
283+
<C-U> | scroll up half a page
284+
<PageUp> | scroll down a whole page
285+
<PageDown> | scroll up a whole page
286+
<Home> | select first entry
287+
<End> | select last entry
288+
289+
The plugin can also provide a table of contents in man pages, markdown files,
290+
and terminal buffers. In the latter, the entries will be the past executed
291+
shell commands. To find those, the following regex is used: >
292+
293+
^\w\+@\w\+:\f\+\$\s
294+
295+
This is meant to match a default bash prompt. If it doesn't match your prompt,
296+
you can change the regex with the `shell_prompt` key from the `g:helptoc`
297+
dictionary variable: >
298+
299+
let g:helptoc = {'shell_prompt': 'regex matching your shell prompt'}
300+
301+
Tip: After inserting a pattern to look for with the `/` command, if you press
302+
<Esc> instead of <CR>, you can then get more context for each remaining entry
303+
by pressing `J` or `K`.
249304

250305
==============================================================================
251306
2. Translated help files *help-translated*

runtime/doc/tags

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8062,11 +8062,13 @@ hasmapto() builtin.txt /*hasmapto()*
80628062
hebrew hebrew.txt /*hebrew*
80638063
hebrew.txt hebrew.txt /*hebrew.txt*
80648064
help helphelp.txt /*help*
8065+
help-TOC helphelp.txt /*help-TOC*
80658066
help-buffer-options helphelp.txt /*help-buffer-options*
80668067
help-context help.txt /*help-context*
80678068
help-curwin tips.txt /*help-curwin*
80688069
help-summary usr_02.txt /*help-summary*
80698070
help-tags tags 1
8071+
help-toc-install helphelp.txt /*help-toc-install*
80708072
help-translated helphelp.txt /*help-translated*
80718073
help-writing helphelp.txt /*help-writing*
80728074
help-xterm-window helphelp.txt /*help-xterm-window*

runtime/doc/version9.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*version9.txt* For Vim version 9.1. Last change: 2024 Oct 27
1+
*version9.txt* For Vim version 9.1. Last change: 2024 Nov 02
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -41602,6 +41602,7 @@ Changed~
4160241602
selection in the quickfix list with the "u" action.
4160341603
- the putty terminal is detected using an |TermResponse| autocommand in
4160441604
|defaults.vim| and Vim switches to a dark background
41605+
- the |help-TOC| package is included to ease navigating the documentation.
4160541606

4160641607
*added-9.2*
4160741608
Added ~

0 commit comments

Comments
 (0)