mirror of
https://github.com/CompeyDev/my-nvim-setup.git
synced 2024-12-13 21:40:37 +00:00
28 lines
637 B
Lua
28 lines
637 B
Lua
|
-- autosave.nvim plugin disabled by default
|
||
|
local autosave
|
||
|
if
|
||
|
not pcall(
|
||
|
function()
|
||
|
func = require "autosave"
|
||
|
end
|
||
|
)
|
||
|
then
|
||
|
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
|
||
|
},
|
||
|
write_all_buffers = true,
|
||
|
on_off_commands = true,
|
||
|
clean_command_line_interval = 2500
|
||
|
}
|
||
|
)
|