better-escape.nvim icon indicating copy to clipboard operation
better-escape.nvim copied to clipboard

Is it possible to map different mappings with different keys?

Open milanglacier opened this issue 2 years ago • 4 comments

require("better_escape").setup { mapping = {"jk"}, -- a table with mappings to use timeout = vim.o.timeoutlen, -- the time in which the keys must be hit in ms. Use option timeoutlen by default clear_empty_lines = false, -- clear line after escaping if there is only whitespace keys = "<Esc>", -- keys used for escaping, if it is a function will use the result everytime -- example() -- keys = function() -- return vim.api.nvim_win_get_cursor(0)[2] > 1 and 'l' or '' -- end, }

This is my current config. But I have mapped 'kj' to abort/close nvim-cmp's auto-complete popup menu, so I would be interested in having another mapping "kj" to support that functionality.

milanglacier avatar Apr 07 '22 05:04 milanglacier

So you want to map kj to esc (with better-escape.nvim)?

max397574 avatar Apr 07 '22 06:04 max397574

So you want to map kj to esc (with better-escape.nvim)?

I want to map jk to escape, and kj mapped to nvm.cmp.close()/nvim.cmp.abort()

milanglacier avatar Apr 07 '22 09:04 milanglacier

so basically sou want two different keys ?

max397574 avatar Apr 07 '22 10:04 max397574

It's easy but out of scope for this plugin.

xiyaowong avatar Apr 11 '22 11:04 xiyaowong