surprising behavior with -u: variable defaults not set?

Visto 27 veces
Saltar al primer mensaje no leído

Danek Duvall

no leída,
23 sept 2016, 13:58:4723/9/16
a v...@vim.org
I copied my .vimrc to a different location, and started vim with -u
/tmp/.vimrc. I would have expected the same behavior as I get by just
running vim normally, but I get a few errors:

E528: Must specify a ' value: viminfo+=r/var/tmp/dduvall/mutt-
E117: Unknown function: pathogen#infect

Neither of which make much sense to me. viminfo is supposed to have a
default that includes a ' value, and that line works just fine when running
vim normally. I looked around in :help startup, but didn't see anything
about -u skipping variable initializations. The first part of section 3
says that all the rest of section 3 is skipped if -u is used, but a, b, and
d don't apply to me, and c refers again to .vimrc (which is a little
confusing). Nowhere does it say anything about internal variable defaults
as a thing to be skipped or reordered or whatever.

The second one could be similar -- I don't know why autoloaded functions
wouldn't be found.

I saw this first with 8.0 (trying to track down a weird behavior that's
reasonably new), but this happens with 7.4, too, so I suspect I'm just
missing something.

Thanks,
Danek

Dominique Pellé

no leída,
23 sept 2016, 15:28:0923/9/16
a Vim List,Danek Duvall,v...@vim.org
Hi

That's probably because when using ~/.vimrc file, it implies
that vim runs with 'nocompatible' mode, whereas when you
use vim -u ... it runs in 'compatible' mode.

See :help 'compatible' and :help -u

If you add "set compatible" in your ~/.vimrc near the top,
before moving it, then I'd expect vim -u /tmp/.vimrc to work
as when using the default ~/.vimrc.

Regards
Dominique

Danek Duvall

no leída,
23 sept 2016, 15:51:0223/9/16
a Dominique Pellé,Vim List
On Fri, Sep 23, 2016 at 09:27:24PM +0200, Dominique Pellé wrote:
>
> That's probably because when using ~/.vimrc file, it implies
> that vim runs with 'nocompatible' mode, whereas when you
> use vim -u ... it runs in 'compatible' mode.
>
> See :help 'compatible' and :help -u
>
> If you add "set compatible" in your ~/.vimrc near the top,
> before moving it, then I'd expect vim -u /tmp/.vimrc to work
> as when using the default ~/.vimrc.

Exactly so. Thanks for clearing that up for me.

Danek
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos