From 3bcbf22de1a0c0f393c7e926c23e4114768f0662 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Fri, 26 Apr 2013 18:06:30 +0200 Subject: [PATCH] create session dir on demand --- autoload/startify.vim | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/autoload/startify.vim b/autoload/startify.vim index 9a1d842..a56e586 100644 --- a/autoload/startify.vim +++ b/autoload/startify.vim @@ -34,8 +34,18 @@ endfunction function! startify#save_session(...) abort if !isdirectory(g:startify_session_dir) - echo 'The session directory does not exist: '. g:startify_session_dir - return + if exists('*mkdir') + echo 'The session directory does not exist: '. g:startify_session_dir .'. Create it? [y/n]' | redraw + if nr2char(getchar()) == 'y' + call mkdir(g:startify_session_dir, 'p') + else + echo + return + endif + else + echo 'The session directory does not exist: '. g:startify_session_dir + return + endif endif let spath = g:startify_session_dir . startify#get_sep() . (exists('a:1') \ ? a:1