: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?
:rviminfodo 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
– Greg Nisbet Nov 23 '17 at 17:12.viminfowithout opening and closing it? The format of a bare bones.viminfoentry> filename.txt, next line\t*\t<timestamp>\t0seems simple enough to write a script for, but a "supported" way would be a bit nicer.:rviminfo!(with explanationm ark) to force a re-read of the.viminfo.see `:h oldfiles` for more info. – tron5 Nov 24 '17 at 07:38
viminfobut 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 yourarglistTake a look at these vimcast arglist, vimgrep, file explorer – statox Nov 24 '17 at 12:02viminfocan be properly shared across vim instances. To allow merging of information, neovim usesshadafiles instead ofviminfofiles. I imagine you need to look into using MRU plugin or roll your own solution. – Peter Rincker Nov 27 '17 at 17:05