Trying to use Harpoon2 and running into an issue after initialization and on the first time I am trying to add a file to the harpoon list:
E5108: Error executing lua: /Users/jordanbourne/.config/nvim/init.lua:574: attempt to call method 'list' (a nil value)
stack traceback:
/Users/jordanbourne/.config/nvim/init.lua:574: in function </Users/jordanbourne/.config/nvim/init.lua:573>
This is my config:
{
'ThePrimeagen/harpoon',
branch = 'harpoon2',
opts = {
menu = {
width = vim.api.nvim_win_get_width(0) - 4,
},
settings = {
save_on_toggle = true,
},
},
keys = function()
local keys = {
{
'<leader>H',
function()
require('harpoon'):list():add()
end,
desc = 'Harpoon File',
},
{
'<leader>h',
function()
local harpoon = require 'harpoon'
harpoon.ui:toggle_quick_menu(harpoon:list())
end,
desc = 'Harpoon Quick Menu',
},
}
for i = 1, 5 do
table.insert(keys, {
'<leader>' .. i,
function()
require('harpoon'):list():select(i)
end,
desc = 'Harpoon to File ' .. i,
})
end
return keys
end,
}
Note: I also tried a fresh nvim config install on the LazyVim setup and was running into the same issue.
Trying to use Harpoon2 and running into an issue after initialization and on the first time I am trying to add a file to the harpoon list:
This is my config:
Note: I also tried a fresh nvim config install on the LazyVim setup and was running into the same issue.