optimize session handling
parent
d27336e6df
commit
6c2df0572b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue