map another key to a map overridden by mini #1009
-
How can I map something to a default keybind overridden by mini? In my case, I want to use |
Beta Was this translation helpful? Give feedback.
Answered by
echasnovski
Jul 3, 2024
Replies: 1 comment 1 reply
-
Unfortunately, there is no easy answer to that. The most robust way is to use some version of the following code (here it is for your use case): local remap = function(mode, lhs_from, lhs_to)
local keymap = vim.fn.maparg(lhs_from, mode, false, true)
local rhs = keymap.callback or keymap.rhs
if rhs == nil then error('Could not remap from ' .. lhs_from .. ' to ' .. lhs_to) end
vim.keymap.set(mode, lhs_to, rhs, { desc = keymap.desc })
end
remap('n', 'gx', '<Leader>gx')
remap('x', 'gx', '<Leader>gx') |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
echasnovski
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately, there is no easy answer to that.
The most robust way is to use some version of the following code (here it is for your use case):