From eec27882da4e56ea8d02e6490e13f563c2cf03ae Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Thu, 15 Dec 2022 11:41:46 -0500 Subject: [PATCH] vim: Allow saving in directories that don't exist Now those directories will be automatically created as needed. --- vim/.vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vim/.vimrc b/vim/.vimrc index 9eeda7d..bdbc006 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -208,6 +208,9 @@ nnoremap 2 :PencilSoft:Goyo:hi vertsplit ctermfg=0 cter nnoremap 3 :mksession! ~/.vim/.session nnoremap 4 :source ~/.vim/.session +" Never worry about a directory not being created before saving +autocmd BufWritePre,FileWritePre * silent! call mkdir(expand(':p:h'), 'p') + " ========================= " ========= netrw ========= " =========================