mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-23 17:28:33 +02:00
feat: optimise autosave.nvim
This commit is contained in:
@@ -82,27 +82,10 @@ return {
|
|||||||
|
|
||||||
{
|
{
|
||||||
"0x00-ketsu/autosave.nvim",
|
"0x00-ketsu/autosave.nvim",
|
||||||
-- autosave.nvim should be loaded immediately.
|
-- lazy-loading on events
|
||||||
-- it enable itself in the `config` function.
|
event = { "InsertLeave", "TextChanged" },
|
||||||
lazy = false,
|
opts = function(_, opts)
|
||||||
-- config is executed when the plugin loads.
|
opts.prompt_style = "notify" -- or stdout
|
||||||
config = function()
|
|
||||||
require("autosave").setup({
|
|
||||||
enable = true,
|
|
||||||
prompt_style = 'notify',
|
|
||||||
prompt_message = function()
|
|
||||||
return "Auto saved at " .. vim.fn.strftime("%H:%M:%S")
|
|
||||||
end,
|
|
||||||
events = { "InsertLeave", "TextChanged" },
|
|
||||||
conditions = {
|
|
||||||
exists = true,
|
|
||||||
modifiable = true,
|
|
||||||
filename_is_not = {},
|
|
||||||
filetype_is_not = {},
|
|
||||||
},
|
|
||||||
write_all_buffers = false,
|
|
||||||
debounce_delay = 135,
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user