1

This question already has an answer here:

My current &viminfo contents are:

:set viminfo?

viminfo=!,'100,<50,s10,h,n/home/ravi/.local/share/vim/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

marked as duplicate by statox, jamessan, muru Oct 21 '16 at 5:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    See the issues 3469 and 3736 – Christian Brabandt Oct 20 '16 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 '16 at 10:30
  • 2
    @TomHale So your question is a duplicate of this one right? – statox Oct 20 '16 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 '16 at 6:27
  • Should I open a question about E576 and answer it myself? – Tom Hale Oct 21 '16 at 6:33
3

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
endif
  • Thanks - I now get clean neovim startup. Winning at life. – Tom Hale Oct 21 '16 at 6:28

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