aboutsummaryrefslogtreecommitdiff
path: root/plugin/write_mkpath.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-31 22:02:49 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-31 22:34:37 +1200
commit2c20e459fafbf7f571833ce9a26143878c4f5902 (patch)
tree2e90aa8eaa51b42fb1ea3ee80348f08ab42bcb77 /plugin/write_mkpath.vim
parentRemove unneeded variable scoping (diff)
downloadvim-write-mkpath-2c20e459fafbf7f571833ce9a26143878c4f5902.tar.gz
vim-write-mkpath-2c20e459fafbf7f571833ce9a26143878c4f5902.zip
Handle :cd then buffer write of non-existent path
Diffstat (limited to 'plugin/write_mkpath.vim')
-rw-r--r--plugin/write_mkpath.vim4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugin/write_mkpath.vim b/plugin/write_mkpath.vim
index 334f24e..c7c9543 100644
--- a/plugin/write_mkpath.vim
+++ b/plugin/write_mkpath.vim
@@ -12,6 +12,8 @@ endif
" Check path to every file before it's saved
augroup write_mkpath
autocmd!
+ autocmd BufNewFile *
+ \ call write_mkpath#New(expand('<afile>'))
autocmd BufWritePre *
- \ call write_mkpath#(expand('<afile>:p:h'))
+ \ call write_mkpath#Write(expand('<afile>'))
augroup END