Friday, September 23, 2016

Re: surprising behavior with -u: variable defaults not set?

Danek Duvall <duvall@comfychair.org> wrote:

> 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

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

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: