I know that the :oldfiles command will show you a history of the files you last had open; but how do I open the last n files in one command...for instance, say I want to open files 0-n in the :oldfiles list, is there a way to do that?
Asked
Active
Viewed 136 times
3
leeand00
- 3,555
- 5
- 24
- 40
1 Answers
4
The files listed by :oldfiles are also available as a list in v:oldfiles, so something like:
for f in v:oldfiles[:10]
exec "badd" f
endfor
Using an appropriate value instead of 10, of course.
muru
- 24,838
- 8
- 82
- 143
:browse oldfileswill allow you to pick one from the list, but it doesn't open say the last n files. – leeand00 Jun 07 '17 at 03:09