Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [viminfo]

If you exit `vim` and later start it again, you would normally lose a lot of information. The `viminfo` file can be used to remember that information, which enables you to continue where you left off.

Filter by
Sorted by
Tagged with
0 votes
1 answer
77 views

Vim commandline history and viminfo

I can't understand why when I open (Win10) gvim91 and press :<up> I don't see my most recent command. I'm sure it used to be this way in previous versions of vim (I updated recently). What I see ...
Tom's user avatar
  • 67
0 votes
1 answer
94 views

Read viminfo when argc() > 0

Does Vim read the viminfo when called with a file argument? How can I force Vim to restore the buffer list in that case? Use case & context What I want is: When called as vi: enable read/write ...
qeatzy's user avatar
  • 958
2 votes
2 answers
602 views

Limit the amount of oldfiles in Vim and Neovim

As simple as the title stated. Suppose I only want to keep the n (say 20) latest files, and the older ones be deleted. How may I configure that?
Luiz Martins's user avatar
3 votes
1 answer
1k views

$VIMINIT conflicts for neovim and vim

Repost from stackoverflow after suggestion I am trying to move from vim to neovim. I have a strange problem. I have, in my .bashrc, exported $VIMINIT to .config/vim/vimrc so that vim files like ....
Abhinav Kulshreshtha's user avatar
0 votes
0 answers
185 views

BufReadPre and reading viminfo file

I need to backup the registers and settings of a limited group of files. I'm more interested in what can be saved in a viminfo file, less interested in sessionss. I'm having a problem reading viminfo ...
Tom's user avatar
  • 67
0 votes
2 answers
562 views

Where are buffer level variables stored in Vim? And how to get their RAM / storage usage?

Where does Vim store b: buffer level variables / dictionaries? RAM or some kind of file on a disk? If it stores it in RAM, how to get an estimate of RAM / storage used by a particular variable / ...
Pastel's user avatar
  • 3
0 votes
0 answers
40 views

Check if any vi process is editing a file, or swapfile exists?

I'm writing a script to ensure that everything I work on on my system is committed, pushed to Git etc. I'd also like to check if there are any vim swapfiles active (either in a running Vim, or from ...
usretc's user avatar
  • 374
2 votes
0 answers
1k views

Strange error when closing Vim

I'm victim of a witchcraft. Likely my own. There's no Vim session open, based on the empty output of pidof vim and can open a new or existing file just fine. When I quit it with :q, however, I see to ...
Enlico's user avatar
  • 2,214
2 votes
0 answers
34 views

Don't want buffer list to be overwritten when I launch vim with filename argument

I have a percent sign in my viminfo string, so my buffer list is saved when I exit vim, and restored when I restart. When I start vim with a filename argument, the buffer list isn't restored, which ...
Paul CyberCitizen's user avatar
1 vote
0 answers
215 views

.viminfo is read-only even after chmod 744

I'm trying to clean out erroneous entries in my command history. Though I could (in theory) use :call histdel("expression") it would be easier for me to just delete the entries from the .viminfo file. ...
Nero gris's user avatar
  • 161
1 vote
1 answer
275 views

Ignore some files when using viminfo+=%

I use in my vimrc the following option: set viminfo+=% This allows vim to open the last edited files if you don't pass any arguments to vim. Is there a way to ignore some files? I want to disable ...
matt's user avatar
  • 113
0 votes
1 answer
468 views

Cannot find the viminfo file to fix the E575 error Windows 10 WSL

I have been using Vim/vi for a while but my computer ran out of space while writing a file and then this error appeared and continues to whenever I open or exit vi. E575: viminfo: Illegal starting ...
DPP's user avatar
  • 1
4 votes
1 answer
278 views

How to encrypt the .viminfo file and still get Vim to read it?

I love using Vim yet have a lot of very sensitive, encrypted files to edit, sometimes on an unencrypted drive, and can't have any residual information from these files forensically accessible to other ...
Incalculon's user avatar
2 votes
1 answer
1k views

In Vim how to keep markers per session?

I use sessions to separate projects in my workflow. - info.txt file that I always mark "I" - log.txt file that I always mark "L" But when I switch sessions, my markers are kept from the last ...
lalo's user avatar
  • 161
0 votes
1 answer
422 views

Why am I getting vim error E576? (Vim 8.1, Windows 10)

Every time I open a file (by which I mean what I would call a text file, typically one containing Python code) I get two lines of error messages that read E576: viminfo: Missing '>' in line: ...
user avatar
1 vote
3 answers
2k views

E138: Can't write viminfo file $HOME/.viminfo! root $HOME not set in vim

When I :q vim on my debian root account (not even writing), it always displays an error message: E138: Can't write viminfo file $HOME/.viminfo! .viminfo didn't exist, so I created it and checked ...
user5977070's user avatar
5 votes
2 answers
3k views

How to remove entries from v:oldfiles list in neovim

I renamed a big folder that contains a lot of files I recently edited. After changing the name, my neovim's v:oldfiles list contains the old names that is no longer accessible. How can I clean the ...
doraemon's user avatar
  • 1,667
1 vote
1 answer
236 views

Can capitalized marks be saved in session INSTEAD of viminfo?

Marks are saved in .viminfo I would like to have separate marks saved per session. Is there an easy setting to make this switch? I know I could write some vimscript to save my session marks ...
Wumbo's user avatar
  • 157
4 votes
2 answers
272 views

Exclude file pattern from keeping it in viminfo history?

I am comforable with using history of edited files that is kept in viminfo, the one that sets the limit in the first setting of set viminfo='100,... variable. After I've started using mutt as email ...
Tag Wint's user avatar
  • 213
0 votes
1 answer
385 views

Where are my recent commands stored in Vim?

So I have made about 10/12 substitutions in my current file using %s/longpatternN//g. Unfortunately I have to apply these same substitutions in 10 or more of my files. I can access my last commands ...
MD. Mohiuddin Ahmed's user avatar
3 votes
2 answers
4k views

Moving .viminfo file to .vim dir

According to this FAQ for moving .viminfo file to .vim dir we should add viminfo+=n~/.vim/viminfo to vimrc file but when I put this line in my vimrc, every time I open vim, it will return this: E492: ...
Cy8099's user avatar
  • 433
2 votes
1 answer
158 views

How to get pathname of viminfo file after vim started

If vim started with vim -i ~/tmp/.viminfo, how can I extract that pathname after vim started? Since upon exiting vim, history, mark, buf-list, etc will automatically write to that file, thus it must ...
qeatzy's user avatar
  • 958
2 votes
1 answer
3k views

Vim does not save any usage history (E886: Can't rename viminfo file)

I just installed Vim and gVim, version 8.0.1026 under Windows 16 64bits. Everything works well, except that the program(s) can't save any historical information about my usage (e.g. recent files, ...
Louis15's user avatar
  • 133
1 vote
2 answers
437 views

Viminfo truncates named registers. Setting to increase limit?

I save quite a few lines into a named register "iy100l. I can then paste from that register just fine, "ip. I close and reopen Vim then try to paste from that register again "ip but it's truncated to ...
Simon George's user avatar
26 votes
1 answer
51k views

What are the .viminfo and .netrwhist files?

I was wondering what's the purpose of .viminfo and .netrwhist files?
Luis Veliz's user avatar
5 votes
1 answer
307 views

Ignore word spelling on a per-file/buffer basis

I can add a word to the local dictionary or spellfile with zg. I can use zG to add a word to the internal spellfile, but this still affects all loaded files. How can I add spelling exceptions on a ...
Tom Hale's user avatar
  • 2,691
7 votes
3 answers
1k views

Can't move `viminfo` file - &viminfo reverts upon loading vim

I'm trying to change the location of the viminfo file. Why does the value of &viminfo revert after it is set in vimrc? TL;DR: In my vimrc I have: set nocompatible exec "set viminfo+=n".expand($...
Tom Hale's user avatar
  • 2,691