Bug#438560: Should -N/-C override 'compatible' settings in vimrc files?

Bram Moolenaar Bram at moolenaar.net
Wed Aug 13 20:49:37 UTC 2008


James -

> On Wed, Aug 13, 2008 at 04:58:21AM +0200, Bram Moolenaar wrote:
> > Now that I look at this again, I think we should not change this.  I'll
> > add a remark at the documentation for -C that startup scripts and
> > plugins may change the option and you end up with 'nocompatible' anyway.
> > 
> > If there are plugins that change the 'compatible' option, we should
> > consider that a bug.  Even changing it temporarily and restoring it has
> > side effects.
> 
> I agree that plugins shouldn't change it, but I see valid uses for
> startup scripts to change it.
> 
> > I rather have a clear problem than an unpredictable solution.
> 
> If a user specifies -N/-C on the command-line, this overrides their
> 'compatible' setting from the startup scripts.  It's fairly typical
> configuration precedence.
 
No, -N and -C set the initial value, the startup scripts are run after
that.  If you want to set 'compatible' after the startup scripts
you can use "+set cp".  I'll add a remark in the docs about that.

> I do agree that the other proposed fix (preventing the startup scripts
> =66rom changing 'compatible' if -N/-C was specified) is more
> straight-forward from the user perspective since it only affects
> 'compatible' and not the related settings that they may explicitly set.

We don't have such a thing as making an option read-only.  It
complicates things, so let's not add it.

> Obviously, you have the final say but I think being able to explicitly
> override the config-file behavior via -N/-C is a desireable behavior and
> follows the current spirit of the documentation.

I think you are misinterpreting what -N and -C are for.  They are really
just to set/reset compatible upon startup when you have/have not a
.vimrc file.  And for "vim -u NONE -N".

- Bram

-- 
SOLDIER: What?  Ridden on a horse?
ARTHUR:  Yes!
SOLDIER: You're using coconuts!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram at Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///





More information about the pkg-vim-maintainers mailing list