To search the specific previous command in the command line prompt, use : and your search key. For example; type :p and then press the upper arrow key. It will search the command that starts with p and display those commands for you. You can scroll through the history by using up and down arrow keys.
It's in the file . viminfo (or _viminfo if you are on Windows). It should be in whatever passes for your home directory.
CTRL-^ Edit the alternate file. Mostly the alternate file is the previously edited file. This is a quick way to toggle between two files. It is equivalent to ":e #", except that it also works when there is no file name.
When you open Nautilus (the default file manager) in Ubuntu, there is a “Recent” entry on the left pane that allows you to view the recent files that you have opened.
At least terminal vim stores the previous ten files into ~/.viminfo
in the filemarks section. You can use '0
, '1
, '2
, ... '9
to jump among them.
(Probably only useful for '0
to get back to the last file you were editing, unless your memory is stronger than mine.)
You can also use the :browse oldfiles
command to get a menu with numbers.
The best way that I use is
:browse oldfiles
Easiest way on vim.
There is mru.vim, which adds the :MRU
command.
Very late answer here ... expounding on @sarnolds answer - You can view the file history with the oldfiles command @see :h oldfiles or :h viminfo
:oldfiles
Furthermore, you can have fine-grained file management with views and sessions ... @see :h mkview and :h mksession for specifics ...
There is an Swiss knife of file switching CtrlP plugin, which is also part of janus distributive. It has :CtrlPMRU
command with smart lookup among recently used files.
Note:
CtrlP
maintains its own list of most recent used files in g:ctrlp_cache_dir."mru/cache.txt"
. It is not reusing viminfo (set viminfo?
) which contains a list of file marks. This is useful if you want to clear this list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With