vim-patch:053aee0: runtime(doc): add more pointers to 'completeopt' (#34460)

Before this commit, I had trouble finding information about configuring
the insert mode completion. In particular, it was not clear that the
'wildopt' config that I already had in my vimrc does not apply here.

Also, `insert.txt` barely mentioned 'completeopt' except when
describing popups (I was more interested in bash-like behavior
where the unique prefix of all completions is completed first).

I'm hoping these edits will make the relevant docs easier to find.

closes: vim/vim#17515

053aee01f7

Co-authored-by: Ilya Grigoriev <ilyagr@users.noreply.github.com>
This commit is contained in:
zeertzjq
2025-06-12 07:32:07 +08:00
committed by GitHub
parent 6bee2f686f
commit 47df8f5a4b
4 changed files with 21 additions and 0 deletions

View File

@@ -639,6 +639,9 @@ and one of the CTRL-X commands. You exit CTRL-X mode by typing a key that is
not a valid CTRL-X mode command. Valid keys are the CTRL-X command itself, not a valid CTRL-X mode command. Valid keys are the CTRL-X command itself,
CTRL-N (next), and CTRL-P (previous). CTRL-N (next), and CTRL-P (previous).
By default, the possible completions are showed in a menu and the first
completion is inserted into the text. This can be adjusted with 'completeopt'.
To get the current completion information, |complete_info()| can be used. To get the current completion information, |complete_info()| can be used.
Also see the 'infercase' option if you want to adjust the case of the match. Also see the 'infercase' option if you want to adjust the case of the match.

View File

@@ -1651,6 +1651,9 @@ A jump table for the options with a short description can be found at |Q_op|.
completion in the preview window. Only works in completion in the preview window. Only works in
combination with "menu" or "menuone". combination with "menu" or "menuone".
This option does not apply to |cmdline-completion|. See 'wildoptions'
for that.
*'completeslash'* *'csl'* *'completeslash'* *'csl'*
'completeslash' 'csl' string (default "") 'completeslash' 'csl' string (default "")
local to buffer local to buffer
@@ -7232,6 +7235,9 @@ A jump table for the options with a short description can be found at |Q_op|.
d #define d #define
f function f function
This option does not apply to |ins-completion|. See 'completeopt' for
that.
*'winaltkeys'* *'wak'* *'winaltkeys'* *'wak'*
'winaltkeys' 'wak' string (default "menu") 'winaltkeys' 'wak' string (default "menu")
global global

View File

@@ -1184,6 +1184,9 @@ vim.go.cia = vim.go.completeitemalign
--- completion in the preview window. Only works in --- completion in the preview window. Only works in
--- combination with "menu" or "menuone". --- combination with "menu" or "menuone".
--- ---
--- This option does not apply to `cmdline-completion`. See 'wildoptions'
--- for that.
---
--- @type string --- @type string
vim.o.completeopt = "menu,popup" vim.o.completeopt = "menu,popup"
vim.o.cot = vim.o.completeopt vim.o.cot = vim.o.completeopt
@@ -7925,6 +7928,9 @@ vim.go.wim = vim.go.wildmode
--- d #define --- d #define
--- f function --- f function
--- ---
--- This option does not apply to `ins-completion`. See 'completeopt' for
--- that.
---
--- @type string --- @type string
vim.o.wildoptions = "pum,tagfile" vim.o.wildoptions = "pum,tagfile"
vim.o.wop = vim.o.wildoptions vim.o.wop = vim.o.wildoptions

View File

@@ -1640,6 +1640,9 @@ local options = {
preview Show extra information about the currently selected preview Show extra information about the currently selected
completion in the preview window. Only works in completion in the preview window. Only works in
combination with "menu" or "menuone". combination with "menu" or "menuone".
This option does not apply to |cmdline-completion|. See 'wildoptions'
for that.
]=], ]=],
full_name = 'completeopt', full_name = 'completeopt',
list = 'onecomma', list = 'onecomma',
@@ -10290,6 +10293,9 @@ local options = {
is displayed per line. Often used tag kinds are: is displayed per line. Often used tag kinds are:
d #define d #define
f function f function
This option does not apply to |ins-completion|. See 'completeopt' for
that.
]=], ]=],
full_name = 'wildoptions', full_name = 'wildoptions',
list = 'onecomma', list = 'onecomma',