18 lines
412 B
Lua
Raw Normal View History

2021-07-12 10:47:09 +02:00
local M = {}
---@class Persistence.Config
2021-07-12 10:47:09 +02:00
local defaults = {
dir = vim.fn.stdpath("state") .. "/sessions/", -- directory where session files are saved
save_empty = false, -- don't save if there are no open file buffers
2021-07-12 10:47:09 +02:00
}
---@type Persistence.Config
2021-07-12 10:47:09 +02:00
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