On 2014-08-07, dhulme wrote:
> Sorry, I tried to water down the issue to the point that I failed
> to demonstrate the issue.

No problem.  I appreciate the effort.  My "explanation" was more a
collection of facts than an explanation.  I'll try again here.

> The issue is:
> 
> *** It doesn't load the viminfo at all when I use use -u ***

That's correct.  My understanding is that it should not, unless the
file specified by -u sets 'nocompatible' or you also use -N.

When you use -u, you are putting vim into compatible mode, as I
wrote before and as explained in ":help -u".

In compatible mode, vim initializes 'viminfo' to empty.  I can't
find anyplace where that is stated explicitly, but ":help 'viminfo'"
says,

    Vi default: ""

The Vi default is what you would expect when 'compatible' is set,
and some experimentation shows it to be true.

Further in that :help section it says,

    When non-empty, the viminfo file is read upon startup and
    written when exiting Vim.

That implies that when 'viminfo' is empty, the viminfo file is _not_
read.

In summary, using -u sets 'viminfo' to empty which causes the
viminfo file to not be read.

When you _don't_ use -u, then vim uses several means to determine
whether it is in compatible or nocompatible mode, including
detecting the presence of a vimrc file.  (See ":help 'compatible'"
and ":help compatible-default".)  If vim detects a ~/.vimrc file, it
will set 'nocompatible'.

In nocompatible mode on Unix, vim initializes 'viminfo' to

    '100,<50,s10,h

This is non-empty.  Therefore, vim reads the viminfo file upon
startup.

> What am I missing?
> 
> I don't have any global vimrc etc., that I can see.  But if I did,
> should -u ~/.vimrc change any of that vs. the default option to
> load ~/.vimrc?

Yes, as explained above.

You can see if a system/global vimrc was read by executing

    :scriptnames

and looking at the first line or two.

> This test was done with the following vim:
> 
> ----------------------------------------
> 
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun  1 2014 17:05:47)
> Included patches: 1-316
> Compiled by <[email protected]>

The Cygwin vim package doesn't include a system vimrc file.  CentOS
might.  Fedora does.

I hope that's clear.

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui