mirror of
https://github.com/zoriya/auto-save.nvim.git
synced 2026-08-06 22:28:06 +00:00
25 lines
558 B
Lua
25 lines
558 B
Lua
local config = {}
|
|
|
|
config.options = {
|
|
enabled = true,
|
|
execution_message = "AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"),
|
|
events = {"InsertLeave", "TextChanged"},
|
|
write_all_buffers = false,
|
|
on_off_commands = false,
|
|
save_only_if_exists = true,
|
|
excluded_filetypes = {},
|
|
clean_command_line_interval = 0
|
|
}
|
|
|
|
function config.set_options(opts)
|
|
opts = opts or {}
|
|
|
|
for opt, _ in pairs(opts) do
|
|
if (config.options[opt] ~= nil) then -- not nil
|
|
config.options[opt] = opts[opt]
|
|
end
|
|
end
|
|
end
|
|
|
|
return config
|