:browse oldfiles<cr>
is useful for quickly navigating to a file I've worked on recently.
Sometimes though, I want to suspend vim
and do some grep
or ack
search and find a new file that I'm interested in (let's call it sneaky.h
). If I open a fresh vim
using vim sneaky.h
and then close it immediately, sneaky.h
will appear in the oldfiles
list the next time I launch vim.
However, my original vim
instance, the one I started before searching for sneaky.h
, does not have the file in the oldfiles
list.
Is there a way to direct vim to refresh the oldfiles
list and populate it again without restarting vim?
Also, is there a more efficient way to get a file like sneaky.h
into the oldfiles
pool without opening it and closing it immediately?
:rviminfo
do the trick?:h :rviminfo
. – statox♦ Nov 23 '17 at 16:47:find
,grep
, the file explorer netrw or fuzzy finding plugins like ctrl-p or fzf – statox♦ Nov 23 '17 at 16:49ctags
-able, I tend to search in the shell and use a fresh vim instance. Is there a way to get a file into.viminfo
without opening and closing it? The format of a bare bones.viminfo
entry> filename.txt
, next line\t*\t<timestamp>\t0
seems simple enough to write a script for, but a "supported" way would be a bit nicer. – Gregory Nisbet Nov 23 '17 at 17:12:rviminfo!
(with explanationm ark) to force a re-read of the.viminfo
.<br/> <br/> see:h oldfiles
for more info. – tron5 Nov 24 '17 at 7:38viminfo
but it is because it is not actually meant to be used this way. See the XY problem What you actually need is a way to search for a file (you can do this in a lot of different ways) and then manipulate yourarglist
Take a look at these vimcast arglist, vimgrep, file explorer – statox♦ Nov 24 '17 at 12:02