On Tue, Mar 7, 2017 at 3:52 PM, David Fishburn <
dfishb...@gmail.com> wrote:
>
> On Thu, Jan 26, 2017 at 8:52 AM, David Fishburn <
dfishb...@gmail.com>
> wrote:
>>
>> I use the following line in my vimrc (Windows):
>>
>> set
>> viminfo=\"50,'500,:500,/500,h,f1,rA:,r$TEMP:,r$TMP:,r$TMPDIR:!,n$VIM/_viminfo
>>
>>
>> For Vim 5,6,7 this works as expected and the _viminfo file is created in
>> my $VIM root directory.
>>
>> When I upgraded to Vim 8, now the _viminfo is being created in whatever
>> directory I launched Vim from. I have been through the docs and do not see
>> what might be causing it.
I'm surprised by this affirmation. By default, the viminfo is read and
written in your $HOME directory instead, or, on Windows only, in $VIM
if $HOME is not set.
The problem is that your system vimrc is sourced too early (see :help
startup) and that, as you found out, if you don't have a .vimrc Vim
sets its "new defaults", similar to what the vimrc_example.vim used to
do; but this happens when looking for a user vimrc and not finding
one, thus after the system vimrc (if any) has been sourced.
If, as is recommended, you had put your user defaults in a "user
vimrc" (in your $HOME directory, thus applying only to you), not in a
system-wide "system vimrc" (applying to every login name on your
system), you wouldn't have had this problem.
If you have a user vimrc, sourcing the vimrc_example.vim from it will
still implicitly source the defaults.vim too, but after that point in
your vimrc you can override any default that doesn't suit you. For
instance I use "filetype indent off" when coming back from sourcing
the example vimrc, because I don't like the way Vim does
autoindenting. As for the viminfo, having it in $HOME suits me so I
don't set its name, I just use
if has('viminfo')
set vi='500,!,%,c
if has('unix')
set vi+=r/mnt/
endif
endif " +viminfo
Best regards,
Tony.