diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-07-06 23:55:37 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-07-06 23:55:37 +1200 |
commit | 4620fc91ff048b4bb1b87980faff046ec5da6b38 (patch) | |
tree | 48810f3ac0e94d6c06e058ef4d8145afeb1036b4 /vim | |
parent | Expand arguments to :CreatePath (diff) | |
download | dotfiles-4620fc91ff048b4bb1b87980faff046ec5da6b38.tar.gz dotfiles-4620fc91ff048b4bb1b87980faff046ec5da6b38.zip |
Handle path expansion in CreatePath
Diffstat (limited to 'vim')
-rw-r--r-- | vim/autoload/path.vim | 5 | ||||
-rw-r--r-- | vim/vimrc | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/vim/autoload/path.vim b/vim/autoload/path.vim index 2506ad53..410cd294 100644 --- a/vim/autoload/path.vim +++ b/vim/autoload/path.vim @@ -2,9 +2,10 @@ function! path#Create(name, ...) abort if a:0 > 2 echoerr 'Too many arguments' endif - if isdirectory(a:name) + let name = expand(a:name) + if isdirectory(name) return 1 endif let prot = a:0 >= 1 ? a:1 : 0755 - return mkdir(a:name, 'p', prot) + return mkdir(name, 'p', prot) endfunction @@ -111,7 +111,7 @@ endif " provide alternative permissions in the second argument. " command! -bar -complete=dir -nargs=+ CreatePath - \ call path#Create(expand(<f-args>)) + \ call path#Create(<f-args>) " Now that we have a way to create directories if they don’t already exist, " let’s apply it for the first time to the user runtime directory. Note that |