I like consulting my oldfiles
to see what I've been working on recently and to make it easy to find files that are buried deep in various directories. Before I started using the grep
and make
commands, the oldfiles
list only contained files I had intentionally visited, for the most part.
I've recently started using grep
and other commands that populate the quickfix list, but most of the matches I end up with are not interesting. However, these non-interesting matches end up polluting my oldfiles
list and limiting its usefulness.
Is it possible to exempt files visited by cnext
and cprevious
from being considered visited from the perspective of oldfiles
.
The ideal solution would be something like an argument to cnext
or cprevious
that controls whether the file counts as visited or not for the purposes of oldfiles
, i.e. cnext-silent
or something like that if it existed.
" begin .vimrc
nnoremap ( :cprevious<cr>
nnoremap ) :cnext<cr>
" end .vimrc
For instance, suppose we have GHC (the Glasgow Haskell Compiler) checked out at ~/git/ghc
and we search for unwind
on a whim by executing :grep -r unwind .
.
if we press )
(rebound in the vimrc), this ends up polluting the oldfiles list with things I didn't actually work on.
1: ~/git/ghc/utils/genapply/Main.hs
2: ~/git/ghc/rts/StgMiscClosures.cmm
3: ~/git/ghc/rts/StgStartup.cmm
4: ~/git/ghc/rts/win32/veh_excn.c
5: ~/git/ghc/testsuite/tests/typecheck/should_compile/T4524.hs
6: ~/git/ghc/rts/Exception.cmm
7: ~/git/ghc/rts/Libdw.h
8: ~/git/ghc/rts/PrimOps.cmm
9: ~/git/ghc/rts/RaiseAsync.c
10: ~/git/ghc/rts/StgCRun.c
11: ~/git/ghc/compiler/nativeGen/X86/Ppr.hs