optimize session handling

main
Mathias Rothenhaeusler 2024-12-27 14:17:13 +01:00
parent d27336e6df
commit 6c2df0572b
1 changed files with 15 additions and 3 deletions

View File

@ -131,9 +131,21 @@ return {
-- Lua sesion manager
{
"olimorris/persisted.nvim",
lazy = false, -- make sure the plugin is always loaded at startup
config = true
lazy = false,
opts = {
autoload = false,
autosave = true,
use_git_branch = true,
},
config = function(_, opts)
local persisted = require("persisted")
persisted.branch = function()
local branch = vim.fn.systemlist("git branch --show-current")[1]
return vim.v.shell_error == 0 and branch or nil
end
persisted.setup(opts)
end,
}
-- {
-- "folke/persistence.nvim",
-- event = "BufReadPre", -- this will only start session saving when an actual file was opened