Closed Hajneken closed 5 months ago
Solved the problem in the meantime. Here's the config that works.
{
"ggandor/leap.nvim",
enabled = true,
keys = {'\\'},
config = function(_, opts)
local leap = require("leap")
for k, v in pairs(opts) do
leap.opts[k] = v
end
leap.add_default_mappings(true)
vim.keymap.del({ "x", "o" }, "x")
vim.keymap.del({ "x", "o" }, "X")
vim.keymap.set({'n','x','o'},'\\','<Plug>(leap)')
end,
}
Glad it's solved. However, no need to use keys
(https://github.com/ggandor/leap.nvim/issues/191), also, add_default_mappings
is deprecated. If you want bidirectional, it's easier to just manually define all mappings anyway, instead of using the helper method and then deleting the unnecessary mappings (https://github.com/ggandor/leap.nvim?tab=readme-ov-file#installation [Alternative key mappings], or :help leap-custom-mappings
).
Environment: WSL Ubuntu, NvChad (lazy.vim)
Within my
~/.config/nvim/lua/custom/plugins.lua
I am using the suggested Full Spec configuration for leap suggested in the lazy.vim plugins docs.Problem: I am trying to use, let's say, the
\
key for both forward and backward leap. Unfortunately pressing\
is ignored. I tried various other keys, even distinct keys for forward and backward leap without success.I might have missed something. Frankly I am a bit lost in all the configuration. However, if I put the suggested Full Spec configuration config, it works as expected: