What do you need to know about viminfo file?

What do you need to know about viminfo file?

The viminfo file is used to store: The command line history. The search string history. The input-line history. Contents of non-empty registers. Marks for several files. File marks, pointing to locations in files. Last search/substitute pattern (for ‘n’ and ‘&’). The buffer list. Global variables.

How to delete search and command history in Vim?

The history is persisted in the viminfo file; you can configure what (and how many of them) is persisted via the ‘viminfo’ (and ‘history’) options. You can even delete just certain history ranges or matching lines.

How is my viminfo option set in vimrc?

It turn out that the viminfo option is overwritten by the nocompatible flag. Since it overwrite other option too, it is better to place “set nocompatible” at very start of your vimrc file. This solved my issue with viminfo configuration.

Where do I find my previous files in Vim?

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.

How to view recent file history in Vim?

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

How to edit a previous command in Vim?

When you press : to enter a command, or / to start a search, you often want to edit a previous command or search. That can be done using the up and down arrow keys to scroll through the history. Then you can edit a previous line. :help :

Where is my viminfo file on Windows 10?

I believe vim will use this as $HOME. In my case, the _viminfo is located in the C:\\Users\\ , which is the home directory, while the %HOME% is not set as well. It was indeed in C:\\Users\\ \\_viminfo. The command :echo $HOME works a charm as well. – roblogic Apr 8 ’15 at 15:18

Where do I find the vimruntime identife in Vim?

$VIMRUNTIME identifes a directory where Vim’s support files are located. Many of the files are not necessary for Vim to run, but are used to provide extra functionality such as syntax highlighting and filetype-based plugins. Its value can be displayed in Vim with the command :echo $VIMRUNTIME.