2021-07-15 15:43:17 +00:00
|
|
|
-- autosave.nvim plugin disabled by default
|
2021-07-17 11:14:52 +00:00
|
|
|
local present, autosave = pcall(require, "autosave")
|
|
|
|
if not present then
|
2021-07-15 15:43:17 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
autosave.setup(
|
|
|
|
{
|
|
|
|
enabled = vim.g.auto_save, -- takes boolean value from init.lua
|
|
|
|
execution_message = "autosaved at : " .. vim.fn.strftime("%H:%M:%S"),
|
|
|
|
events = {"InsertLeave", "TextChanged"},
|
|
|
|
conditions = {
|
|
|
|
exists = true,
|
|
|
|
filetype_is_not = {},
|
|
|
|
modifiable = true
|
|
|
|
},
|
2021-07-16 17:52:36 +00:00
|
|
|
write_all_buffers = false,
|
2021-07-15 15:43:17 +00:00
|
|
|
on_off_commands = true,
|
|
|
|
clean_command_line_interval = 2500
|
|
|
|
}
|
|
|
|
)
|