aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-09 23:38:12 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-09 23:38:12 +1200
commit5cf80518010e7376427ddfac00a4f35c63bbe84c (patch)
treec349f329e755b82cdb2b1ddc3613a2a9de1b8830
parentRestore -nargs=1 for :EnsureDir (diff)
downloaddotfiles-5cf80518010e7376427ddfac00a4f35c63bbe84c.tar.gz
dotfiles-5cf80518010e7376427ddfac00a4f35c63bbe84c.zip
Document :EnsureDir command as well as function
-rw-r--r--vim/vimrc6
1 files changed, 6 insertions, 0 deletions
diff --git a/vim/vimrc b/vim/vimrc
index e7622c54..a705c1d4 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -148,6 +148,12 @@ function s:EnsureDir(path) abort
return isdirectory(path)
\ || exists('*mkdir') && mkdir(path, 'p', 0700)
endfunction
+
+" Now we define the :EnsureDir command for user-level access to the
+" s:EnsureDir() function. We set the tab completion to provide directory
+" names as candidates, and specify that there must be only one argument, which
+" we'll provide as a quoted parameter to the function.
+"
command! -complete=dir -nargs=1 EnsureDir
\ call s:EnsureDir(<q-args>)