From a43ba6966d8295fde274e3a70937bb4f70e7c1e1 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 27 Jun 2019 09:15:49 +1200 Subject: Factor out mkdir() calls into function --- vim/vimrc | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'vim') diff --git a/vim/vimrc b/vim/vimrc index 6032d01a..653780d6 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -2,6 +2,10 @@ if !exists('$LANG') && &encoding ==# 'latin1' set encoding=utf-8 endif scriptencoding utf-8 +function! s:Mkpath(path) abort + return isdirectory(a:path) + \ || exists('*mkdir') && mkdir(a:path) +endfunction function! s:OptionSplit(string) abort return map( \ split(&runtimepath, '\\\@