From 5fb1352ca01ab278d208d6573929c4b8ec4e1ed5 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Mon, 2 Mar 2015 22:06:10 +0100 Subject: [PATCH] Don't clutter v:oldfiles during [,l]vimgrep --- plugin/startify.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugin/startify.vim b/plugin/startify.vim index b019a9a..575020b 100644 --- a/plugin/startify.vim +++ b/plugin/startify.vim @@ -9,6 +9,7 @@ if exists('g:loaded_startify') || &cp finish endif let g:loaded_startify = 1 +let g:startify_locked = 0 augroup startify if !get(g:, 'startify_disable_at_vimenter') @@ -18,6 +19,9 @@ augroup startify if get(g:, 'startify_session_persistence') autocmd VimLeave * call s:extinction() endif + + autocmd QuickFixCmdPre *vimgrep* let g:startify_locked = 1 + autocmd QuickFixCmdPost *vimgrep* let g:startify_locked = 0 augroup END function! s:genesis() @@ -28,7 +32,10 @@ function! s:genesis() call startify#insane_in_the_membrane() endif endif - autocmd startify BufNewFile,BufRead * if exists('v:oldfiles') | call insert(v:oldfiles, expand(''), 0) | endif + autocmd startify BufNewFile,BufRead * + \ if !g:startify_locked && exists('v:oldfiles') | + \ call insert(v:oldfiles, expand(''), 0) | + \ endif autocmd! startify VimEnter endfunction