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