aboutsummaryrefslogtreecommitdiff
path: root/plugin/write_mkpath.vim
blob: 64bb6c2d7f517fec872321518ca5865d931614c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"
" write_mkpath: Create any missing path elements in the path to a buffer's
" filename before the buffer is written.
"
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"  
if exists('loaded_write_mkpath') || &compatible || v:version < 703
  finish
endif

" Check path to every file before it's saved
augroup write_mkpath
  autocmd!
  autocmd BufWritePre *
        \ call write_mkpath#(expand('<afile>'))
augroup END