Open db757 opened 4 months ago
Just leaving, same thing happens to me. Really annoying. :(
@db757 Hello mate, I found an alternative approach. It may not perfectly fit your situation, but hopefully, it will help.
Avoid mapping it exactly as-is:
vim.keymap.set("n", "<C-[>", function() harpoon:list():prev() end)
vim.keymap.set("n", "<C-]>", function() harpoon:list():next() end)
but, for example, change it to:
vim.keymap.set("n", "<C-h>", function() harpoon:list():prev() end)
vim.keymap.set("n", "<C-l>", function() harpoon:list():next() end)
(BTW, I use the urxvt as terminal emulator)
I tried to remove the <Esc>
keymap for normal mode. It seemed to work at first, but it broke the keymap for harpoon:list():prev()
as well.
vim.keymap.del('n', '<Esc>')
vim.keymap.set("n", "<C-[>", function() harpoon:list():prev() end) -- just broken
-- However, I was still able to run `lua require('harpoon'):list():prev()` in ex mode, and it worked fine.
What's strange is that without the keymap vim.keymap.set("n", "<C-[>", function() harpoon:list():prev() end)
, deleting the keymap for <Esc>
throws an error saying 'No such mapping'.
I didn't realize that there is no such keymap for <Esc>
for normal mode by default.
Whenever I have at least one item in the harpoon list, hitting
Esc
in normal mode in any buffer jumps to the buffer that's in the first harpoon entry. If there's no entries in the list then nothing happens (as expected).Here's my lazy config: