In a .vimrc, is `set nocompatible` completely useless?

If it is the system-wide vimrc, this option won’t be off. So, if you’re changing the system-wide vimrc and you want it, you need to set it.

From the documentation section *compatible-default* (emphasis mine):

When Vim starts, the ‘compatible’
option is on. This will be used when
Vim starts its initializations. But
as soon as a user vimrc file is found,
or a vimrc file in the current
directory
, or the “VIMINIT”
environment variable is set, it will
be set to ‘nocompatible’.

Another difference is that explicitly setting ‘nocompatible’ overrules calling vim with the -C flag.

In any other scenario, yes, setting ‘nocompatible’ in your vimrc is a noop.

In the end I think it’s just a matter of “better safe than sorry”.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)