From bdb42577bab5e2448ce62d46fced4f22db9f6bc0 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Tue, 7 Jan 2025 11:55:14 +0100 Subject: [PATCH] Fix autosave when exiting/suspending vim --- nvim/lua/plugins/auto-save.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nvim/lua/plugins/auto-save.lua b/nvim/lua/plugins/auto-save.lua index 8bd85cd..2757611 100644 --- a/nvim/lua/plugins/auto-save.lua +++ b/nvim/lua/plugins/auto-save.lua @@ -20,6 +20,10 @@ return { local ft = vim.fn.getbufvar(buf, "&filetype") return ft ~= "oil" and ft ~= "harpoon" and ft ~= "qf" end, + trigger_events = { + -- TODO: upstream this + immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" }, + } }, beforeAll = function() vim.g.auto_save_state = true