My current &viminfo contents are:

:set viminfo?


I want to have a single vimrc which works with both vim and neovim.

What lines can I add to my vimrc to set use:

  • In vim: /home/ravi/.local/share/vim/viminfo
  • In neovim: the default
  • 1
    See the issues 3469 and 3736 Oct 20, 2016 at 10:25
  • Thanks, I have already - my question is about how to implement a different ,n<name> depending on whether I'm in vim or neovim.
    – Tom Hale
    Oct 20, 2016 at 10:30
  • 2
    @TomHale So your question is a duplicate of this one right?
    – statox
    Oct 20, 2016 at 10:47
  • While the resolution is in the "duplicate", I believe that this question has a bunch of valuable information which will help people in determining: 1) The cause of E576 is &viminfo 2) Why and 3) What to do about it while keeping viminfo set as desired when using vim.
    – Tom Hale
    Oct 21, 2016 at 6:27
  • Should I open a question about E576 and answer it myself?
    – Tom Hale
    Oct 21, 2016 at 6:33

1 Answer 1


I would suggest appending your specific additions to the viminfo option rather than duplicating default information. That is, set viminfo+=!.

Additionally, it seems like setting the n option isn't necessary. However, if you want to do that then you can simply do that in a non-nvim check.

if !has('nvim')
  set viminfo+=n~/.local/share/vim/viminfo
  • Thanks - I now get clean neovim startup. Winning at life.
    – Tom Hale
    Oct 21, 2016 at 6:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.