From de709a4dbe9bda4e9dc489d8fd68330ea7ca4b58 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Mon, 7 Mar 2016 13:21:16 +0100 Subject: [PATCH] New option: g:startify_update_oldfiles References #192. --- doc/startify.txt | 11 +++++++++++ plugin/startify.vim | 8 +++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/doc/startify.txt b/doc/startify.txt index 32e0905..66d4c18 100644 --- a/doc/startify.txt +++ b/doc/startify.txt @@ -98,6 +98,7 @@ default values. |g:startify_list_order| |g:startify_relative_path| |g:startify_skiplist| + |g:startify_update_oldfiles| Misc options:~ |g:startify_custom_footer| @@ -200,6 +201,15 @@ Example: < The number of files to list. +------------------------------------------------------------------------------ + *g:startify_update_oldfiles* +> + let g:startify_update_oldfiles = 0 +< + +Usually |v:oldfiles| only gets updated when Vim exits. Using this option updates +it on-the-fly, so that :Startify is always up-to-date. + ------------------------------------------------------------------------------ *g:startify_session_autoload* > @@ -805,6 +815,7 @@ This is my configuration.. let g:startify_files_number = 8 let g:startify_relative_path = 1 let g:startify_change_to_dir = 1 + let g:startify_update_oldfiles = 1 let g:startify_session_autoload = 1 let g:startify_session_persistence = 1 let g:startify_session_delete_buffers = 1 diff --git a/plugin/startify.vim b/plugin/startify.vim index 9dd06fa..b18fe7d 100644 --- a/plugin/startify.vim +++ b/plugin/startify.vim @@ -42,9 +42,11 @@ function! s:genesis() call startify#insane_in_the_membrane() endif endif - call map(v:oldfiles, 'fnamemodify(v:val, ":p")') - autocmd startify BufNewFile,BufRead,BufFilePre * - \ call s:update_oldfiles(expand(':p')) + if get(g:, 'startify_update_oldfiles') + call map(v:oldfiles, 'fnamemodify(v:val, ":p")') + autocmd startify BufNewFile,BufRead,BufFilePre * + \ call s:update_oldfiles(expand(':p')) + endif autocmd! startify VimEnter endfunction