add :SDelete

This commit is contained in:
Marco Hinz 2013-05-02 21:16:26 +02:00
parent 48d748cf0a
commit d671a0957c
4 changed files with 27 additions and 2 deletions

View file

@ -32,6 +32,27 @@ function! startify#is_in_skiplist(arg) abort
endfor
endfunction
function! startify#delete_session(...) abort
if !isdirectory(g:startify_session_dir)
echo 'The session directory does not exist: '. g:startify_session_dir
return
endif
let spath = g:startify_session_dir . startify#get_separator() . (exists('a:1')
\ ? a:1
\ : input('Delete this session: ', '', 'custom,startify#get_session_names_as_string'))
\ | redraw
echo 'Really delete '. spath .'? [y/n]' | redraw
if (nr2char(getchar()) == 'y')
if delete(spath) == 0
echo 'Deleted session '. spath .'!'
else
echo 'Deletion failed!'
endif
else
echo 'Deletion aborted!'
endif
endfunction
function! startify#save_session(...) abort
if !isdirectory(g:startify_session_dir)
if exists('*mkdir')