From 327a2d57eb94f672a501ce1a6a37bfb5f35f8281 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 9 Sep 2025 08:27:05 +0800 Subject: vim-patch:d7d6a6f: runtime(doc): Improve doc for cmdline-autocompletion - Address https://github.com/vim/vim/pull/18219#issuecomment-3264634710 - Make the cmdline-autocompletion help more user friendly closes: vim/vim#18245 https://github.com/vim/vim/commit/d7d6a6f05a536b443188ff95a45bbd46485f11fb Co-authored-by: Girish Palya --- runtime/lua/vim/_meta/vimfn.lua | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'runtime/lua') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index af8e4b786c..4f367d1a53 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -10835,7 +10835,6 @@ function vim.fn.wildmenumode() end --- Start wildcard expansion in the command-line, using the --- behavior defined by the 'wildmode' and 'wildoptions' settings. ---- See |cmdline-completion|. --- --- This function also enables completion in search patterns such --- as |/|, |?|, |:s|, |:g|, |:v| and |:vimgrep|. @@ -10843,22 +10842,15 @@ function vim.fn.wildmenumode() end --- Unlike pressing 'wildchar' manually, this function does not --- produce a beep when no matches are found and generally --- operates more quietly. This makes it suitable for triggering ---- completion automatically, such as from an |:autocmd|. ---- *cmdline-autocompletion* ---- Example: To make the completion menu pop up automatically as ---- you type on the command line, use: >vim ---- autocmd CmdlineChanged [:/\?] call wildtrigger() ---- set wildmode=noselect:lastused,full wildoptions=pum ---- < ---- 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& ---- < +--- completion automatically. +--- +--- Note: After navigating command-line history, the first call to +--- wildtrigger() is a no-op; a second call is needed to start +--- expansion. This is to support history navigation in +--- command-line autocompletion. +--- +--- See |cmdline-autocompletion|. +--- --- Return value is always 0. --- --- @return number -- cgit