-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Next/previous works for command and search completion, but not in substitute command #92
Comments
I'm having the same issue. I can get the
The bindings reported by neovim:
... points to In neovim's default
I vaguely recall in vimscript options for setting a value with the first item in the popup list... it may be a need to review this behavior in the command window mode. The conflict with Command-line editing mode4. Command-line editing *ex-edit-index*Get to the command-line with the ':', '!', '/' or '?' commands. tag command action in Command-line editing mode
------------------------------------------------------------------------------
CTRL-@ not used
|c_CTRL-A| CTRL-A do completion on the pattern in front of the
cursor and insert all matches
|c_CTRL-B| CTRL-B cursor to begin of command-line
|c_CTRL-C| CTRL-C same as <Esc>
|c_CTRL-D| CTRL-D list completions that match the pattern in
front of the cursor
|c_CTRL-E| CTRL-E cursor to end of command-line
|'cedit'| CTRL-F default value for 'cedit': opens the
command-line window; otherwise not used
|c_CTRL-G| CTRL-G next match when 'incsearch' is active
|c_<BS>| <BS> delete the character in front of the cursor
|c_digraph| {char1} <BS> {char2}
enter digraph when 'digraph' is on
|c_CTRL-H| CTRL-H same as <BS>
|c_<Tab>| <Tab> if 'wildchar' is <Tab>: Do completion on
the pattern in front of the cursor
|c_<S-Tab>| <S-Tab> same as CTRL-P
|c_wildchar| 'wildchar' Do completion on the pattern in front of the
cursor (default: <Tab>)
|c_CTRL-I| CTRL-I same as <Tab>
|c_<NL>| <NL> same as <CR>
|c_CTRL-J| CTRL-J same as <CR>
|c_CTRL-K| CTRL-K {char1} {char2}
enter digraph
|c_CTRL-L| CTRL-L do completion on the pattern in front of the
cursor and insert the longest common part
|c_<CR>| <CR> execute entered command
|c_CTRL-M| CTRL-M same as <CR>
|c_CTRL-N| CTRL-N after using 'wildchar' with multiple matches:
go to next match, otherwise: recall older
command-line from history.
CTRL-O not used
|c_CTRL-P| CTRL-P after using 'wildchar' with multiple matches:
go to previous match, otherwise: recall older
command-line from history.
|c_CTRL-Q| CTRL-Q same as CTRL-V, unless it's used for terminal
control flow
|c_CTRL-R| CTRL-R {regname}
insert the contents of a register or object
under the cursor as if typed
|c_CTRL-R_CTRL-R| CTRL-R CTRL-R {regname}
|c_CTRL-R_CTRL-O| CTRL-R CTRL-O {regname}
insert the contents of a register or object
under the cursor literally
CTRL-S not used, or used for terminal control flow
|c_CTRL-T| CTRL-T previous match when 'incsearch' is active
|c_CTRL-U| CTRL-U remove all characters
|c_CTRL-V| CTRL-V insert next non-digit literally, insert three
digit decimal number as a single byte.
|c_CTRL-W| CTRL-W delete the word in front of the cursor
CTRL-X not used (reserved for completion)
CTRL-Y copy (yank) modeless selection
CTRL-Z not used (reserved for suspend)
|c_<Esc>| <Esc> abandon command-line without executing it
|c_CTRL-[| CTRL-[ same as <Esc>
|c_CTRL-\_CTRL-N| CTRL-\ CTRL-N go to Normal mode, abandon command-line
|c_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to Normal mode, abandon command-line
CTRL-\ a - d reserved for extensions
|c_CTRL-\_e| CTRL-\ e {expr} replace the command line with the result of
{expr}
CTRL-\ f - z reserved for extensions
CTRL-\ others not used
|c_CTRL-]| CTRL-] trigger abbreviation
|c_CTRL-^| CTRL-^ toggle use of |:lmap| mappings
|c_CTRL-_| CTRL-_ when 'allowrevins' set: change language
(Hebrew)
|c_<Del>| <Del> delete the character under the cursor
|c_<Left>| <Left> cursor left
|c_<S-Left>| <S-Left> cursor one word left
|c_<C-Left>| <C-Left> cursor one word left
|c_<Right>| <Right> cursor right
|c_<S-Right>| <S-Right> cursor one word right
|c_<C-Right>| <C-Right> cursor one word right
|c_<Up>| <Up> recall previous command-line from history that
matches pattern in front of the cursor
|c_<S-Up>| <S-Up> recall previous command-line from history
|c_<Down>| <Down> recall next command-line from history that
matches pattern in front of the cursor
|c_<S-Down>| <S-Down> recall next command-line from history
|c_<Home>| <Home> cursor to start of command-line
|c_<End>| <End> cursor to end of command-line
|c_<PageDown>| <PageDown> same as <S-Down>
|c_<PageUp>| <PageUp> same as <S-Up>
|c_<Insert>| <Insert> toggle insert/overstrike mode
|c_<LeftMouse>| <LeftMouse> cursor at mouse click updateI resolved the conflicting use of |
Same problem here |
I filed #108 yesterday; could be related to this. |
Same issues here Following a minimal config to reproduce the defect : --------------------------------------------------------------------------------
-- Plug-in Installation
--------------------------------------------------------------------------------
local vim = vim
local Plug = vim.fn["plug#"]
vim.call("plug#begin")
-- {{{
-- Completion
Plug("hrsh7th/nvim-cmp")
Plug("f3fora/cmp-spell")
Plug("hrsh7th/cmp-buffer")
Plug("hrsh7th/cmp-cmdline")
Plug("hrsh7th/cmp-nvim-lsp")
Plug("hrsh7th/cmp-path")
-- }}}
vim.call("plug#end")
--------------------------------------------------------------------------------
-- Cmp-Nvim
--------------------------------------------------------------------------------
--{{
local cmp = require("cmp")
cmp.setup({
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "spell" },
{ name = "luasnip" },
{ name = "path" },
{ name = "buffer" },
}),
enabled = function()
local context = require("cmp.config.context")
if vim.api.nvim_get_mode().mode == "c" then
return true
else
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment")
end
end,
})
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
{ name = "buffer" },
{ name = "cmdline" },
}),
})
--}}}
The workaround provided by EdmundsEcho does not work for my config. This is not related 108. This one work well with the minimal config provided. |
same here cmp.setup.cmdline({ ':' }, {
completion = { autocomplete = false },
mapping = mapping,
sources = {
{ name = 'path' },
{ name = 'cmdline' },
{
name = 'buffer',
option = {
keyword_pattern = [[\k\+]],
get_bufnrs = function()
local bufs = {}
for _, win in ipairs(vim.api.nvim_list_wins()) do
bufs[vim.api.nvim_win_get_buf(win)] = true
end
return vim.tbl_keys(bufs)
end
},
},
}) |
Hey there!
If I do the following in the command line:
:Lsp
, cmp offers to complete the commands and<C-n>
and<C-p>
successfully let me navigate up and down.Likewise, if I do
/thing
, cmp offers to complete the search term and the mappings work.However, if I do
:s/thing
or:%s/thing
, cmp offers to complete the search term, but the mappings do not work.Here's a demonstration:
cmp-cmdline.mp4
You can't see that I'm pressing
<C-n>
and<C-p>
at then end when the substitute completion pops up (because it doesn't work), but I was. 😂Here is my config (using lazy.nvim). Please let me know if you would like me to try to make one that's a more minimal reproduction.
The text was updated successfully, but these errors were encountered: