As far as I can tell I don't set viminfo
anywhere, yet it is set.
:verbose set viminfo?
prints
viminfo='100,<50,s10,h,rA:,rB:
Last set from ~/vimfiles/vimrc
But ~/vimfiles/vimrc
doesn't set it.
Even if I let ~/vimfiles/vimrc
set it to an arbitrary value, viminfo
will still be set to '100,<50,s10,h,rA:,rB:
.
Why is that and how can I set/unset viminfo
?
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. Show activity on this post.
If you type echo $HOME in command mode, Vim should display what value is set for HOME. Alternatively, you can try e $HOME\.viminfo and see if this opens the contents of the .viminfo file. If this is the case, you have found it!
There are two ways to use the Vim setting options: 1. Enable the options for an individual file inside the Vim session using :set Open the desired file in Vim, type any option using the :set command in the Normal mode, and press Enter. 2.
:verbose set viminfo? But ~/vimfiles/vimrc doesn't set it. Even if I let ~/vimfiles/vimrc set it to an arbitrary value, viminfo will still be set to '100,<50,s10,h,rA:,rB:.
You can set viminfo
by temporary and permanent way:
:set
viminfo=xxxx
~/.vimrc
in Linux and $VIM/_vimrc
in Windows My setting as below:
set viminfo=%,<800,'10,/50,:100,h,f0,n~/.vim/cache/.viminfo
" | | | | | | | + viminfo file path
" | | | | | | + file marks 0-9,A-Z 0=NOT stored
" | | | | | + disable 'hlsearch' loading viminfo
" | | | | + command-line history saved
" | | | + search history saved
" | | + files marks saved
" | + lines saved each register (old name for <, vi6.2)
" + save/restore buffer list
And, the most important is set viminfo=xxx
should come after set nocompatible
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With