Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VIM recently edited files history

Tags:

vim

history

Is there a history of files edited in VIM that persists between vim sessions, e.g. last 20 opened files. I tend to edit the same .conf files and I have to navigate to them each time of course they are spread all over the filesystem.

like image 469
Attila Avatar asked Aug 11 '10 10:08

Attila


People also ask

How do I view 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.

Does vim save history?

saving history seems to be the default. you may need to check $HOME/. viminfo file. it keeps command history in it.

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.


1 Answers

Actually this behavior IS built in. With default settings you should be able to use the :oldfiles command to view a numbered list of recent files. Then use :e #>4 for example, to edit number 4 in the list. Or :browse oldfiles, according to this answer.

like image 177
Ben Avatar answered Dec 30 '22 12:12

Ben