-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lazy.nvim resets custom mappings when using keys
#191
Comments
I cannot reproduce, the problem is not with this mapping itself, it should work. |
Right, thanks for confirming that! |
I just narrowed down the issue I had,fyi this is triggered by setting it like this: require('lazy').setup({
{
'ggandor/leap.nvim',
keys = {'s'}
-- with this keys lazy loading option,
-- at each leap it calls lua/leap/main.lua: line 1202
-- it also depends on the
-- and it will get reset to default vim s key
}
})
vim.keymap.set({ 'n', 'x', 'o' }, 's', function()
local current_window = vim.fn.win_getid()
require('leap').leap({ target_windows = { current_window } })
end, { noremap = true}) Despite said here in the readme that lazy loading isn't necessary, there would potentially still be people like me who interpret the wording as lazy loading leap wouldn't result in unexpected behavior(s). Would it be possible to state this somewhere? |
@ggandor sorry for the ping, I forgot to reopen the issue. Could you please take another look? |
Sure, but I don't fully understand the problem (what Lazy is doing in the background), and cannot really follow the comment in your code snippet, so please walk me through this then. |
So the problem I had was lazy would reset the keybinds when I use the lazy load on keypress option, if I decided to disable the default keymaps and only map |
did you try this? require('lazy').setup({
{
'ggandor/leap.nvim',
keys = {
"s",
function()
require('leap').leap()
end,
mode = { "x", "n" },
desc = "Leap",
}
}
}) |
@Sleepful This would only work with the first leap. On the second leap it shows:
|
keys
Did anyone find a solution to this? |
see LazyVim/LazyVim#2379 (comment) for solution |
TL;DR: don't use |
I will close it since it's not a leap issue |
As title suggested, if I map any key that is one of the default keys, e.g.
s
to bidirectional leap it only work once:And after leaping for the first time
s
would get remapped back to the default vim one. This might be caused by executing unbinding during every leapThe text was updated successfully, but these errors were encountered: