Attila
Attila

Reputation: 578

VIM recently edited files 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.

Upvotes: 9

Views: 5112

Answers (5)

Ben
Ben

Reputation: 8905

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.

Upvotes: 5

jtpereyda
jtpereyda

Reputation: 7395

As this answer indicates, one may use ctrl-o to jump backward in file history. It will automatically open previously edited files.

Upvotes: 3

skeept
skeept

Reputation: 12423

You should consider giving ctrlp a chance (if you are not using it now). It provides the command:

:CtrlPMRUFiles

that let's you select previous opened files. That is besides all the other cool stuff. I was using the MRU plugin mentioned by @DrAI but once I started using ctrlp I just use that one.

Another popular plugin that provides a mru capability is Unite.

Upvotes: 2

Rose Perrone
Rose Perrone

Reputation: 63616

You can use :marks to navigate between recently used files.

Upvotes: 1

DrAl
DrAl

Reputation: 72726

As standard, no, but there's a plugin here that adds this functionality. This one also mentions recent file history on the page, so it may provide an alternative.

Upvotes: 4

Related Questions