Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recent file history in Vim?

Tags:

vim

People also ask

How to check Vim history?

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.

Where is Vim history stored?

It's in the file . viminfo (or _viminfo if you are on Windows). It should be in whatever passes for your home directory.

How do I go to a previous file in Vim?

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.

How do I find recent files in Ubuntu?

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.