From ec2eed9142df0051160367ca18b3cf7142dd7392 Mon Sep 17 00:00:00 2001 From: Brian Di Palma <1597820+briandipalma@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:16:11 +0100 Subject: [PATCH] feat(nvim): Add an auto save autocommand --- dotfiles/nvim/lua/config/autocmds.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dotfiles/nvim/lua/config/autocmds.lua b/dotfiles/nvim/lua/config/autocmds.lua index 9f755cc..3781867 100644 --- a/dotfiles/nvim/lua/config/autocmds.lua +++ b/dotfiles/nvim/lua/config/autocmds.lua @@ -10,3 +10,8 @@ vim.api.nvim_create_autocmd("FileType", { vim.bo.makeprg = "npx tsc --project " .. project_root end, }) + +vim.api.nvim_create_autocmd( + { "FocusLost", "ModeChanged", "TextChanged", "BufEnter" }, + { desc = "autosave", pattern = "*", command = "silent! update" } +)