-
Notifications
You must be signed in to change notification settings - Fork 120
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
cmdline: enter
keymap preset issues
#542
Comments
The default preset for Edit: this is irrelavant pls ignore |
That's actually just an example, it'll use your |
It's a bit unintuitive but I think this behavior makes sense since it matches the behavior in default mode. Maybe you could unmap keymap = {
cmdline = {
preset = 'enter',
['<CR>'] = {}
}
} |
Thanks, that does work. Perhaps there can be separate presets for cmdline with intuitive defaults. Then, doing On second thought, I think the most intuitive solution would be for the cmdline keymap configuration to not be nested inside of the standard keymaps, but to be in e.g. |
I think typically if you wanted to run the first option, you would press enter twice (first to accept, second to run). keymap = {
cmdline = {
preset = 'enter',
-- We don't return so that the fallback runs
['<CR>'] = { function(cmp) cmp.select_and_accept() end, 'fallback' }
}
}
Totally agree! I'm thinking it would make sense to have a |
This should be fixed on |
On the latest commit, you can do something like ['<CR>'] = {
function(cmp)
return cmp.select_and_accept({
callback = function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<CR>', true, true, true), 'n', true)
end,
})
end,
'fallback',
} |
Thanks, this works exactly how I want, as long as I set
This would be perfect! |
As a temporary workaround until this is implemented, in order to use local orig_list_selection
vim.api.nvim_create_autocmd('CmdlineEnter', {
callback = function()
local list = require 'blink.cmp.completion.list'
orig_list_selection = list.config.selection
list.config.selection = 'manual'
end,
})
vim.api.nvim_create_autocmd('CmdlineLeave', {
callback = function()
if orig_list_selection then
local list = require 'blink.cmp.completion.list'
list.config.selection = orig_list_selection
end
end,
}) |
Make sure you have done the following
blink.cmp
Bug Description
When keymap is set to the
enter
preset, there are a few issues:cabbrev
) are not expanded before the command is executed (E492: Not an editor command
)auto_insert
is enabled, when picking a completion item, you need to press enter twice to run the commandRelevant configuration
neovim version
NVIM v0.11.0-dev-1273+g7a367c6967
blink.cmp
version: branch, tag, or commitfb03ca7
The text was updated successfully, but these errors were encountered: