How do I open files from my oldfiles list in vim?


In vim, I can type :oldfiles to see a list of files I've previously edited. Awesome feature!

But now I want to open one or more files from that list into a buffer. How can I do that?


Answers:


If you use :help oldfiles, you will find the command :browse oldfiles which should do what you want.

:bro[wse] ol[dfiles][!]
                        List file names as with |:oldfiles|, and then prompt
                        for a number.  When the number is valid that file from
                        the list is edited.
                        If you get the |press-enter| prompt you can press "q"
                        and still get the prompt to enter a file number.
                        Use ! to abandon a modified buffer. |abandon|
                        {not when compiled with tiny or small features}