Clean up stray swapfiles too

Sun, 05 May 2024 13:45:55 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 05 May 2024 13:45:55 -0500
changeset 1159
9a19621f294c
parent 1158
0e7310186a57
child 1160
28e64ed03c25

Clean up stray swapfiles too

.config/nvim/lua/config/autocmds.lua file | annotate | diff | comparison | revisions
--- a/.config/nvim/lua/config/autocmds.lua
+++ b/.config/nvim/lua/config/autocmds.lua
@@ -54,6 +54,7 @@ end)
 -- >> Prune old backup and undo files at startup
 autocmd(g, "User", "VeryLazy", function()
   local prune_files = require("config.util").prune_files
+  if vim.go.swapfile then prune_files(vim.go.directory, 90) end
   if vim.go.backup then prune_files(vim.go.backupdir, 90) end
   if vim.go.undofile then prune_files(vim.go.undodir, 90) end
 end)

mercurial