aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-07-06 23:55:37 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-07-06 23:55:37 +1200
commit4620fc91ff048b4bb1b87980faff046ec5da6b38 (patch)
tree48810f3ac0e94d6c06e058ef4d8145afeb1036b4
parentExpand arguments to :CreatePath (diff)
downloaddotfiles-4620fc91ff048b4bb1b87980faff046ec5da6b38.tar.gz
dotfiles-4620fc91ff048b4bb1b87980faff046ec5da6b38.zip
Handle path expansion in CreatePath
-rw-r--r--vim/autoload/path.vim5
-rw-r--r--vim/vimrc2
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
diff --git a/vim/vimrc b/vim/vimrc
index aa08fcfd..ddece845 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -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