Browse Source

Add :SClose

References #141.
coachshea 11 years ago
parent
commit
b89114f359
2 changed files with 11 additions and 0 deletions
  1. 10 0
      autoload/startify.vim
  2. 1 0
      plugin/startify.vim

+ 10 - 0
autoload/startify.vim

@@ -227,6 +227,16 @@ function! startify#session_save(...) abort
   endif
 endfunction
 
+" Function: #session_close {{{1
+function! startify#session_close() abort
+  if exists('v:this_session') && filewritable(v:this_session)
+    call startify#session_write(fnameescape(v:this_session))
+    let v:this_session = ''
+  endif
+  call startify#session_delete_buffers()
+  Startify
+endfunction
+
 " Function: #session_write {{{1
 function! startify#session_write(spath)
   let ssop = &sessionoptions

+ 1 - 0
plugin/startify.vim

@@ -30,6 +30,7 @@ augroup END
 command! -nargs=? -bar -complete=customlist,startify#session_list SSave   call startify#session_save(<f-args>)
 command! -nargs=? -bar -complete=customlist,startify#session_list SLoad   call startify#session_load(<f-args>)
 command! -nargs=? -bar -complete=customlist,startify#session_list SDelete call startify#session_delete(<f-args>)
+command! -nargs=0 -bar SClose call startify#session_close()
 command! -nargs=0 -bar Startify call startify#insane_in_the_membrane()
 
 nnoremap <silent><plug>(startify-open-buffers) :<c-u>call startify#open_buffers()<cr>