runtime(doc): include a TOC Vim9 plugin
closes: #10446
See :h help-TOC
Signed-off-by: lagygoill <lacygoill@lacygoill.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt
index 40039e3..86c4775 100644
--- a/runtime/doc/helphelp.txt
+++ b/runtime/doc/helphelp.txt
@@ -1,4 +1,4 @@
-*helphelp.txt* For Vim version 9.1. Last change: 2024 Apr 10
+*helphelp.txt* For Vim version 9.1. Last change: 2024 Nov 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -246,6 +246,61 @@
To rebuild the help tags in the runtime directory
(requires write permission there): >
:helptags $VIMRUNTIME/doc
+<
+ *help-TOC* *help-toc-install*
+
+If you want to access an interactive table of contents, from any position in
+the file, you can use the helptoc plugin. Load the plugin with: >
+
+ packadd helptoc
+
+Then you can use the `:HelpToc` command to open a popup menu.
+The latter supports the following normal commands: >
+
+ key | effect
+ ----+---------------------------------------------------------
+ j | select next entry
+ k | select previous entry
+ J | same as j, and jump to corresponding line in main buffer
+ K | same as k, and jump to corresponding line in main buffer
+ c | select nearest entry from cursor position in main buffer
+ g | select first entry
+ G | select last entry
+ H | collapse one level
+ L | expand one level
+ p | print current entry on command-line
+
+ P | same as p but automatically, whenever selection changes
+ | press multiple times to toggle feature on/off
+
+ q | quit menu
+ z | redraw menu with current entry at center
+ + | increase width of popup menu
+ - | decrease width of popup menu
+ ? | show/hide a help window
+
+ <C-D> | scroll down half a page
+ <C-U> | scroll up half a page
+ <PageUp> | scroll down a whole page
+ <PageDown> | scroll up a whole page
+ <Home> | select first entry
+ <End> | select last entry
+
+The plugin can also provide a table of contents in man pages, markdown files,
+and terminal buffers. In the latter, the entries will be the past executed
+shell commands. To find those, the following regex is used: >
+
+ ^\w\+@\w\+:\f\+\$\s
+
+This is meant to match a default bash prompt. If it doesn't match your prompt,
+you can change the regex with the `shell_prompt` key from the `g:helptoc`
+dictionary variable: >
+
+ let g:helptoc = {'shell_prompt': 'regex matching your shell prompt'}
+
+Tip: After inserting a pattern to look for with the `/` command, if you press
+<Esc> instead of <CR>, you can then get more context for each remaining entry
+by pressing `J` or `K`.
==============================================================================
2. Translated help files *help-translated*
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 9091976..1ae1ff6 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -8062,11 +8062,13 @@
hebrew hebrew.txt /*hebrew*
hebrew.txt hebrew.txt /*hebrew.txt*
help helphelp.txt /*help*
+help-TOC helphelp.txt /*help-TOC*
help-buffer-options helphelp.txt /*help-buffer-options*
help-context help.txt /*help-context*
help-curwin tips.txt /*help-curwin*
help-summary usr_02.txt /*help-summary*
help-tags tags 1
+help-toc-install helphelp.txt /*help-toc-install*
help-translated helphelp.txt /*help-translated*
help-writing helphelp.txt /*help-writing*
help-xterm-window helphelp.txt /*help-xterm-window*
diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index 2a38466..66f98e1 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -1,4 +1,4 @@
-*version9.txt* For Vim version 9.1. Last change: 2024 Oct 27
+*version9.txt* For Vim version 9.1. Last change: 2024 Nov 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -41602,6 +41602,7 @@
selection in the quickfix list with the "u" action.
- the putty terminal is detected using an |TermResponse| autocommand in
|defaults.vim| and Vim switches to a dark background
+- the |help-TOC| package is included to ease navigating the documentation.
*added-9.2*
Added ~