`<CR>` keybind is enabled in command mode by default
Closed this issue · 2 comments
From this line https://github.com/m4xshen/autoclose.nvim/blob/main/lua/autoclose.lua#L23, I infer that the autoclose.nvim functionality should not be enabled for <CR>
in command mode by default. However, it is, which messes with my config.
I am not an expert in lua, but I guess the error may be in this line https://github.com/m4xshen/autoclose.nvim/blob/main/lua/autoclose.lua#L150. Should it not read if not info.disable_command_mode then
, because the disable option is set per key and not in the keys
table?
Thanks for the feedback! I want to know how the original functionality messes with your config. Could you explain a little bit?
I have the following in my init.lua
:
-- fish-like command line completion
vim.opt.wildignorecase = true
vim.opt.wildmode = "longest:full,full"
vim.keymap.set("c", "<cr>", function()
if vim.fn.pumvisible() == 1 then
return "<c-y>"
end
return "<cr>"
end, { expr = true })
This makes command mode completion behave exactly the same as command line completion in fish, which I also use (enter adds the highlighted entry of the completion menu to the command and closes the menu, but does not execute the command). Thus simply, if any plugin rebinds <CR>
in command mode, I notice because my muscle memory messes up command completion.
Now everything works as expected again, thanks a lot for your quick reply and this nice plugin. :)