8

I'm trying to disable viminfo completely, I tried to add something in the ~/.vimrc,

I tried 3 different methods, none of them works

set viminfo='0,:0,<0,@0,f0,n~/.viminfo
set viminfo=
set viminfo="None"

Any ideas? I just don't want viminfo to record what files was edited before

The vim version is:

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Dec 10 2016 23:06:12)
MacOS X (unix) version
Included patches: 1-130
Compiled by Homebrew
4
  • set viminfo= should do it. Commented Dec 11, 2016 at 6:33
  • @SatoKatsura Hmm, does not work for me .. Commented Dec 11, 2016 at 6:37
  • Now, that is an useful description of a problem. :) Commented Dec 11, 2016 at 6:57
  • Could you please accept one of these answers, if possible? Commented Apr 1, 2018 at 19:26

3 Answers 3

13

Try invoking Vim with

$ vim -i NONE

From :help -i:

-i {viminfo}    The file "viminfo" is used instead of the default viminfo
                file.  If the name "NONE" is used (all uppercase), no viminfo
                file is read or written, even if 'viminfo' is set or when
                ":rv" or ":wv" are used.
1
  • This along with set clipboard=exclude:.* made it run faster. Thank you. Commented Oct 18, 2017 at 6:34
7

Hope it ain't too late, but I think I figured out how to disable this.

Seems that Vim 8 is enabling the viminfo feature by default (maybe another features are enabled by default that were disabled on previous versions of Vim). So you need to put in your ~/.vimrc or the new /etc/vim/vimrc.local file (if you want to set this as global - you'll need to create that file if you don't have one) the following:

let skip_defaults_vim=1
set viminfo=""

The skip_defaults_vim tells Vim not to load the default Vim configuration file, defaults.vim (for example, located on my Gentoo box at /usr/share/vim/vim80/defaults.vim).

Hope this works on your Mac, as that was driving me insane.

4

Add this line to your .vimrc:

set viminfofile=NONE

From the documentation (:help viminfo-file-name):

- The "-i" Vim argument can be used to set another file name, |-i|.  When the
  file name given is "NONE" (all uppercase), no viminfo file is ever read or
  written.  Also not for the commands below!
- The 'viminfofile' option can be used like the "-i" argument.  In fact, the
  value form the "-i" argument is stored in the 'viminfofile' option.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.