From 993c50bb342aba6f61aa1e3bac5034c3b8e42ed5 Mon Sep 17 00:00:00 2001 From: Squibid Date: Mon, 26 Jun 2023 11:14:21 -0400 Subject: remove mkdir plugin and replace with autocmd --- lua/core/auto.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lua/core/auto.lua') diff --git a/lua/core/auto.lua b/lua/core/auto.lua index 1a20612..3e517ab 100644 --- a/lua/core/auto.lua +++ b/lua/core/auto.lua @@ -46,3 +46,12 @@ auto('TermClose', { o.cmdheight = 1 end }) + +auto('BufWritePre', { -- make dirs when they don't exist + pattern = '*', + group = vim.api.nvim_create_augroup('auto_create_dir', { clear = true }), + callback = function(ctx) + local dir = vim.fn.fnamemodify(ctx.file, ':p:h') + vim.fn.mkdir(dir, 'p') + end +}) -- cgit v1.2.1