I set the viminfo in my .vimrc for making startup faster. However the setting doesn't work.

The setting is:

set viminfo=%,\"100,'10,/50,:100,h,f0,n~/.vim/cache/.viminfo

When I tried to echo &viminfo, the value was just the same as the older (maybe default) one:


I using vim 7.4 which was compiled and installed by myself, here is the version information:

$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 17 2013 16:56:58)
Included patches: 1-131

And this is the source code installation configures:

./configure --enable-gui=gnome2 --enable-cscope --enable-multibyte --enable-xim --enable-fontset --with-features=huge --enable-pythoninterp=yes --enable-python3interp=yes --enable-rubyinterp=yes --enable-python3interp=yes --prefix=/home/marslo/.vim/tools/vim74 --with-compiledby=Marslo > vim-build.log

What's wrong with my setting? What should I do to make the setting work?

  • 1
    Why do you use "100 instead of <100? Could it be possible that you still have an old ~/.viminfo?
    – romainl
    Dec 27, 2013 at 14:29
  • Yeah! That's great idea!! I've changed the \" to <. Thanks.
    – Marslo
    Dec 29, 2013 at 10:50

1 Answer 1


That's easily explained. You have

:set nocompatible

after :set viminfo. The former is a special, important option, which affects others; from :help 'compatible':

This is a special kind of option, because when it's set or reset, other options are also changed as a side effect.

The solution is easy: Move it to the start of your ~/.vimrc, or drop it altogether, as nocompatible is implied by having a .vimrc file.

  • Thanks! I've set nocompatible in my vimrc file (because I'm using vundle). However, the set viminfo=xxx should add after set nocompativle.
    – Marslo
    Dec 29, 2013 at 10:48
  • 1
    Well, there some problem with my Gvim (in win7). viminfo still cannot be set. What should I do?
    – Marslo
    Dec 31, 2013 at 14:02
  • Okay, I fix that.
    – Marslo
    Dec 31, 2013 at 14:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .