A better way to define keymaps using lazy.nvim #1690
Unanswered
KorayAydemir
asked this question in
Q&A
Replies: 1 comment 1 reply
-
In the one you tried that didn't work your are missing the end keyword for the keys function. Try this: local function keys()
local harpoon = require("harpoon")
return {
{
"<leader>a",
function()
harpoon:list():add()
end,
},
{
"<C-e>",
function()
harpoon.ui:toggle_quick_menu(harpoon:list(), toggle_opts)
end,
},
}
end
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = { "nvim-lua/plenary.nvim" },
opts = opts,
keys = keys,
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to avoid this because its much more verbose than it should be:
I tried this:
did not work. loads harpoon on startup. i dont know if its a lazy.nvim problem or a lua problem.
with this method i'm mentioning each key twice. Once in the config function and once in the keys property.
So, why the verbosity ? There has to be a sane way to do lazy loading on key presses. Please show me what i'm missing
Beta Was this translation helpful? Give feedback.
All reactions