From 75d38bb844fe5386df7c1a5efe59a2ce39396b98 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 8 Aug 2025 21:01:54 +0800 Subject: [PATCH] vim-patch:d82c918: runtime(doc): Improve doc for cmdline-autocomplete (#35235) Maybe this was unnecessary, but saw this: https://github.com/vim/vim/issues/17854 https://github.com/vim/vim/commit/d82c918e2f3e6af65c36fb14457968053dcc03a3 Co-authored-by: Girish Palya --- runtime/doc/cmdline.txt | 6 ++++-- runtime/doc/vimfn.txt | 5 +++++ runtime/lua/vim/_meta/vimfn.lua | 5 +++++ src/nvim/eval.lua | 5 +++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 3a1581b2b4..1690042fc9 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -867,7 +867,7 @@ to insert special things while typing you can use the CTRL-R command. For example, "%" stands for the current file name, while CTRL-R % inserts the current file name right away. See |c_CTRL-R|. -Note: If you want to avoid the effects of special characters in a Vim script +Note: If you want to avoid the effects of special characters in a Vim script you may want to use |fnameescape()|. Also see |`=|. @@ -1239,8 +1239,10 @@ Example: > :au CmdwinLeave : let &cpt = b:cpt_save This sets 'complete' to use completion in the current window for |i_CTRL-N|. Another example: > - :au CmdwinEnter [/?] startinsert + :au CmdwinEnter [/\?] startinsert This will make Vim start in Insert mode in the command-line window. +Note: The "?" needs to be escaped, as this is a |file-pattern|. See also +|cmdline-autocompletion|. *cmdline-char* *cmdwin-char* The character used for the pattern indicates the type of command-line: diff --git a/runtime/doc/vimfn.txt b/runtime/doc/vimfn.txt index 9dc35a7cf9..d9c04e0de3 100644 --- a/runtime/doc/vimfn.txt +++ b/runtime/doc/vimfn.txt @@ -11911,6 +11911,11 @@ wildtrigger() *wildtrigger()* To retain normal history navigation (up/down keys): >vim cnoremap cnoremap +< + To set an option specifically when performing a search, e.g. + to set 'pumheight': >vim + autocmd CmdlineEnter [/\?] set pumheight=8 + autocmd CmdlineLeave [/\?] set pumheight& < Return value is always 0. diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 3fdc45eaf6..6c57179ca4 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -10844,6 +10844,11 @@ function vim.fn.wildmenumode() end --- cnoremap --- cnoremap --- < +--- To set an option specifically when performing a search, e.g. +--- to set 'pumheight': >vim +--- autocmd CmdlineEnter [/\?] set pumheight=8 +--- autocmd CmdlineLeave [/\?] set pumheight& +--- < --- Return value is always 0. --- --- @return number diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index e38198ce59..e00bafc92d 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -13102,6 +13102,11 @@ M.funcs = { cnoremap cnoremap < + To set an option specifically when performing a search, e.g. + to set 'pumheight': >vim + autocmd CmdlineEnter [/\?] set pumheight=8 + autocmd CmdlineLeave [/\?] set pumheight& + < Return value is always 0. ]==], name = 'wildtrigger',