Esc falback runs enter in the cmdline #782
-
I set esc to hide menu but when I am cmd and I enter esc to cancel what I am doing, the command I have typed in the cmdline gets run. I mean, if I entered a command keymap = {
preset = "enter",
-- I use <c-e> to go to the end of the line in insert mode
["<C-e>"] = {},
-- a as in abort makes sense to me
["<C-a>"] = { "hide", "fallback" },
["<esc>"] = { "hide", "fallback" },
["<CR>"] = { "accept", "fallback" },
["<C-y>"] = { "select_and_accept" },
["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
} This is my current keymap settings. |
Beta Was this translation helpful? Give feedback.
Answered by
Muizzyranking
Dec 26, 2024
Replies: 1 comment
-
This was already brought up in #547 and doing this solved it for me. keymap = {
preset = "enter",
-- other keymaps
cmdline = {
-- this is where the trick is
["<esc>"] = {
"hide",
"cancel",
function()
if vim.fn.getcmdtype() ~= "" then
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<C-c>", true, true, true), "n", true)
return
end
end,
},
},
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Muizzyranking
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was already brought up in #547 and doing this solved it for me.