Skip to content

Esc falback runs enter in the cmdline #782

Closed Answered by Muizzyranking
Muizzyranking asked this question in Q&A
Discussion options

You must be logged in to vote

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,
          },
        },
      }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Muizzyranking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant