2024-07-06 22:00:20 +02:00

21 lines
499 B
Lua

local M = {}
---@class Persistence.Config
local defaults = {
dir = vim.fn.stdpath("state") .. "/sessions/", -- directory where session files are saved
-- minimum number of file buffers that need to be open to save
-- Set to 0 to always save
need = 1,
branch = true, -- use git branch to save session
}
---@type Persistence.Config
M.options = {}
function M.setup(opts)
M.options = vim.tbl_deep_extend("force", {}, defaults, opts or {})
vim.fn.mkdir(M.options.dir, "p")
end
return M