.config/nvim/lua/config/autocmds.lua

changeset 1165
840f0fde07e2
parent 1161
2543467f42da
child 1166
34bf03fa07e4
--- a/.config/nvim/lua/config/autocmds.lua
+++ b/.config/nvim/lua/config/autocmds.lua
@@ -21,13 +21,11 @@ autocmd(g, { "WinLeave", "FocusLost" }, 
 end)
 
 -- >> auto mkpath on write
-autocmd(g, "BufWritePre", "*", {
-  callback = function(ctx)
-    if vim.bo[ctx.buf].buftype == "" and not string.match(ctx.file, "^[%w]+:") then
-      fn.mkdir(fn.fnamemodify(ctx.file, ":p:h"), "p")
-    end
-  end,
-})
+autocmd(g, "BufWritePre", "*", function(ctx)
+  if vim.bo[ctx.buf].buftype == "" and not string.match(ctx.file, "^[%w]+:") then
+    fn.mkdir(fn.fnamemodify(ctx.file, ":p:h"), "p")
+  end
+end)
 
 -- >> auto session ?
 

mercurial