You can use the :browse
command for that:
:browse oldfiles
For a keystroke, map it:
nnoremap <Leader>o :browse oldfiles<cr>
Then you can press Leader o in normal mode to view a list of files.
From :help v:oldfiles
:
v:oldfiles oldfiles-variable
v:oldfiles List of file names that is loaded from the viminfo file on
startup. These are the files that Vim remembers marks for.
The length of the List is limited by the ' argument of the
'viminfo' option (default is 100).
When the viminfo file is not used the List is empty.
So, to limit at, say, 50 files, you can set viminfo
:
set viminfo+='50
I don't see an easy way of excluding files from this, other than disabling viminfo
using autocmd
:
autocmd BufNew *.sh set viminfo=
This has the huge flaw of disabling all history for any session that involves matching files.
autocmd
does; the former seems like it would be more useful and possibly easier to achieve.)*.tmp,/tmp/*,/mnt/foo/*
.