neovim-session-manager icon indicating copy to clipboard operation
neovim-session-manager copied to clipboard

Remember Harpoon2 files

Open jeroenvermunt opened this issue 10 months ago • 3 comments

I am using this plugin and notices it remembers projects specific harpoon setups, which is amazing!

I noticed this functionality stopped when switching to Harpoon2. For this reason I am staying at harpoon 1.

Would it be possible to preserve the session harpoon state for Harpoon?

jeroenvermunt avatar Apr 22 '24 19:04 jeroenvermunt

I'm not sure, the plugin just tracks last working directories. Can't say what changes between 1 and 2 versions.

Shatur avatar Apr 22 '24 20:04 Shatur

Experience same issue here. Really looking forward if both plugins works well together. It seems that Harpoon tracked listed buffer based on directory where Neovim opened.

wilsonchen719 avatar May 07 '24 14:05 wilsonchen719

Had the same issue. The problem is that harpoon initializes its internal list right when the lua module is first required. I fixed it by loading the harpoon module after the session is loaded.

    local config_group = vim.api.nvim_create_augroup("SessionGroup", {})
    vim.api.nvim_create_autocmd({ "User" }, {
        pattern = "SessionLoadPost",
        group = config_group,
        callback = function()
            ...
            -- Setup harpoon after session is loaded
            require("harpoon")
            ...
        end,
    })

DanielWeidinger avatar Jun 16 '24 11:06 DanielWeidinger