nvim/lua/plugins/auto_save.lua
RingOfStorms (Joshua Bell) 78f04bda73 sessions and nvim tree
2024-05-01 18:11:18 -05:00

23 lines
623 B
Lua

return {
"Pocco81/auto-save.nvim",
event = "BufEnter",
opts = {
execution_message = {
message = function()
return ""
end,
},
trigger_events = { "InsertLeave", "TextChanged", "TextChangedI", "BufLeave" },
condition = function(buf)
local disallowed_filetypes = { "TelescopePrompt", "quickfix", "terminal" }
local utils = require("auto-save.utils.data")
if
vim.fn.getbufvar(buf, "&modifiable") == 1
and utils.not_in(vim.fn.getbufvar(buf, "&filetype"), disallowed_filetypes)
then
return true
end
return false
end,
},
}