changeset 33542:c1e81b86082c

runtime(doc): Improve command-line completion docs (#13331) Commit: https://github.com/vim/vim/commit/2bbd0d30eebdea66c0da3895e83d999ed6ad83fb Author: Yee Cheng Chin <ychin.git@gmail.com> Date: Sat Oct 14 02:23:45 2023 -0700 runtime(doc): Improve command-line completion docs (https://github.com/vim/vim/issues/13331) * Improve command-line completion docs Add more details about 'ignorecase' and its effect on cmdline completion. Make sure keys used in wildmenu are properly documented and linked in the keys' documentation entries, and in `:h index` for proper cross-referencing, as wildmenu popup is slightly different from insert-mode popup menu. * Fix docs typos Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 14 Oct 2023 11:30:10 +0200
parents 281c18121b19
children 1299280b12db
files runtime/doc/cmdline.txt runtime/doc/index.txt runtime/doc/options.txt
diffstat 3 files changed, 49 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -90,9 +90,11 @@ CTRL-SHIFT-Q	Works just like CTRL-V, unl
 		In the GUI the |key-notation| is inserted without simplifying.
 
 							*c_<Left>* *c_Left*
-<Left>		cursor left
+<Left>		cursor left.  See 'wildmenu' for behavior during wildmenu
+		completion mode.
 							*c_<Right>* *c_Right*
-<Right>		cursor right
+<Right>		cursor right.  See 'wildmenu' for behavior during wildmenu
+		completion mode.
 							*c_<S-Left>*
 <S-Left> or <C-Left>					*c_<C-Left>*
 		cursor one WORD left
@@ -102,7 +104,8 @@ CTRL-SHIFT-Q	Works just like CTRL-V, unl
 CTRL-B or <Home>				*c_CTRL-B* *c_<Home>* *c_Home*
 		cursor to beginning of command-line
 CTRL-E or <End>					*c_CTRL-E* *c_<End>* *c_End*
-		cursor to end of command-line
+		cursor to end of command-line.  See 'wildmenu' for behavior
+		during wildmenu completion mode.
 
 							*c_<LeftMouse>*
 <LeftMouse>	Move the cursor to the position of the mouse click.
@@ -237,6 +240,7 @@ CTRL-\ e {expr}						*c_CTRL-\_e*
 CTRL-Y		When there is a modeless selection, copy the selection into
 		the clipboard. |modeless-selection|
 		If there is no selection CTRL-Y is inserted as a character.
+		See 'wildmenu' for behavior during wildmenu completion mode.
 
 CTRL-M or CTRL-J		*c_CTRL-M* *c_CTRL-J* *c_<NL>* *c_<CR>* *c_CR*
 <CR> or <NL>	start entered command
@@ -252,12 +256,14 @@ CTRL-C		quit command-line without execut
 
 							*c_<Up>* *c_Up*
 <Up>		recall older command-line from history, whose beginning
-		matches the current command-line (see below).
+		matches the current command-line (see below).  See 'wildmenu'
+		for behavior during wildmenu completion mode.
 		{not available when compiled without the |+cmdline_hist|
 		feature}
 							*c_<Down>* *c_Down*
 <Down>		recall more recent command-line from history, whose beginning
-		matches the current command-line (see below).
+		matches the current command-line (see below).  See 'wildmenu'
+		for behavior during wildmenu completion mode.
 		{not available when compiled without the |+cmdline_hist|
 		feature}
 
@@ -463,11 +469,16 @@ When repeating 'wildchar' or CTRL-N you 
 ending up back to what was typed.  If the first match is not what you wanted,
 you can use <S-Tab> or CTRL-P to go straight back to what you typed.
 
-The 'wildignorecase' option can be set to ignore case in filenames.
-
 The 'wildmenu' option can be set to show the matches just above the command
 line.
 
+The 'wildoptions' option provides additional configuration to use a popup menu
+for 'wildmenu', and to use fuzzy matching.
+
+The 'wildignorecase' option can be set to ignore case in filenames.  For
+completing other texts (e.g. command names), the 'ignorecase' option is used
+instead (fuzzy matching always ignores case, however).
+
 If you like tcsh's autolist completion, you can use this mapping:
 	:cnoremap X <C-L><C-D>
 (Where X is the command key to use, <C-L> is CTRL-L and <C-D> is CTRL-D)
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1112,6 +1112,22 @@ tag		command		action in Command-line edi
 |c_<Insert>|	<Insert>	toggle insert/overstrike mode
 |c_<LeftMouse>|	<LeftMouse>	cursor at mouse click
 
+commands in wildmenu mode (see 'wildmenu')
+
+		<Up>		move up to parent / select the previous match
+		<Down>		move down to submenu / select the next match
+		<Left>		select the previous match / move up to parent
+		<Down>		select the next match / move down to submenu
+		<CR>		move into submenu when doing menu completion
+		other		stop completion and insert the typed character
+
+commands in wildmenu mode with 'wildoptions' set to "pum"
+
+		CTRL-E		stop completion and go back to original text
+		CTRL-Y		accept selected match and stop completion
+		<PageUp>	select a match several entries back
+		<PageDown>	select a match several entries forward
+
 ==============================================================================
 5. Terminal-Job mode				*terminal-job-index*
 
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -4440,8 +4440,8 @@ A jump table for the options with a shor
 			*'ignorecase'* *'ic'* *'noignorecase'* *'noic'*
 'ignorecase' 'ic'	boolean	(default off)
 			global
-	Ignore case in search patterns.  Also used when searching in the tags
-	file.
+	Ignore case in search patterns, |cmdline-completion|, when
+	searching in the tags file, and non-|Vim9| |expr-==|.
 	Also see 'smartcase' and 'tagcase'.
 	Can be overruled by using "\c" or "\C" in the pattern, see
 	|/ignorecase|.
@@ -9314,29 +9314,32 @@ A jump table for the options with a shor
 	as needed.
 	The "wildmenu" mode is abandoned when a key is hit that is not used
 	for selecting a completion.
-	While the "wildmenu" is active, not using the popup menu, the
+	While the "wildmenu" is active, the following keys have special
+	meanings:
+	CTRL-P		- go to the previous entry
+	CTRL-N		- go to the next entry
+	<CR>		- in menu completion, when the cursor is just after a
+			  dot: move into a submenu.
+
+	When not using the popup menu for command line completion, the
 	following keys have special meanings:
-
 	<Left> <Right>	- select previous/next match (like CTRL-P/CTRL-N)
+	<Up>		- in filename/menu name completion: move up into
+			  parent directory or parent menu.
 	<Down>		- in filename/menu name completion: move into a
 			  subdirectory or submenu.
-	<CR>		- in menu completion, when the cursor is just after a
-			  dot: move into a submenu.
-	<Up>		- in filename/menu name completion: move up into
-			  parent directory or parent menu.
 
 	When using the popup menu for command line completion, the following
 	keys have special meanings:
-	<Down>		- select next match (like CTRL-N)
+	<Up> <Down>	- select previous/next match (like CTRL-P/CTRL-N)
 	<Left>		- in filename/menu name completion: move up into
 			  parent directory or parent menu.
 	<Right>		- in filename/menu name completion: move into a
 			  subdirectory or submenu.
-	<Up>		- select previous match (like CTRL-P)
+	<PageUp>	- Select a match several entries back, but don't insert it.
+	<PageDown>	- Select a match several entries further, but don't insert it.
 	CTRL-E		- end completion, go back to what was there before
 			  selecting a match.
-	CTRL-N		- go to the next entry
-	CTRL-P		- go to the previous entry
 	CTRL-Y		- accept the currently selected match and stop
 			  completion.