Thursday, January 5, 2012

Re: -u .vimrc acts differently from implicit read of .vimrc

On 2012-01-05, Hal Morris wrote:
> I have the following .vimrc file:
>
> :set backupcopy=yes
> :map RR :w<NL>:!ci -l %<NL>
> :map RD :w<NL>:!Rcsdiff %<NL>
> :map <C-P> :!Lpr3 -m -F bold -f -W100 %<NL>
> :set tags=$LD/ptags2
> :syntax enable<NL>
>
> The strange thing is, if I let the file read implicitly because it is in
> ~/.vimrc, it all seems to work.
>
> But, if I invoke vim -u .vimrc
>
> It does not work. Instead, <ctrl/P> causes
>
> :!Lpr3 -m -F bold -f -W100 %<NL>
>
> to appear at the bottom of my screen. To get what I really want I'd have to
> replace the <NL> with <C-V><Enter>
> (by <Enter> I mean the Enter key).
>
> It all worked on an older system running vim 6.1.320. My current system is
> 7.3.315
>
> If it seems like there's an obvious workaround, I am only using this example
> for simplicity.

This is probably because using -u starts vim in compatible mode,
which means it behaves like the original vi. You can fix that
either by also using the -N option like this:

vim -N -u .vimrc

or by putting this line first in your .vimrc:

set nocompatible

See

:help -u

and read the last three sentences. Also

:help compatible

Regards,
Gary

--
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

No comments: