New option: g:startify_session_detection

This commit is contained in:
Marco Hinz 2013-08-08 17:53:40 +02:00
parent f96d217c70
commit 888dcfbc0d
3 changed files with 18 additions and 1 deletions

View file

@ -48,7 +48,10 @@ See `:h startify-options` for more information.
#### 2) Easy session handling
It eases handling of loading, saving and deleting sessions by always working
When the file Session.vim is found in the current directory, it will be shown at
the top of all lists as entry `[0]`.
The handling of loading, saving and deleting sessions is eased by always working
with one and the same directory. These commands are used for convenience:
:SLoad load a session

View file

@ -46,6 +46,12 @@ function! startify#insane_in_the_membrane() abort
call append('$', [' [e] <empty buffer>', ''])
endif
if get(g:, 'startify_session_detection', 1) && filereadable('Session.vim')
call append('$', [' [0] Session.vim', ''])
execute 'nnoremap <buffer> 0 :source Session.vim<cr>'
let cnt = 1
endif
for list in get(g:, 'startify_list_order', ['files', 'sessions', 'bookmarks'])
let cnt = s:show_{list}(cnt)
call append('$', '')

View file

@ -135,6 +135,14 @@ Example: let g:startify_bookmarks = [ '~/.vimrc' ]
The number of files to list.
============-
let g:startify_session_detection = 1
When the file Session.vim is found in the current directory, it will be shown at
the top of all lists as entry [0].
============-
let g:startify_change_to_dir = 1