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

后端 未结 4 912
栀梦
栀梦 2020-12-08 03:45

Several users in this epic question put the following in the .vimrc:

\" Necesary for lots of cool vim things
set nocompatible

4条回答
  •  悲哀的现实
    2020-12-08 04:32

    Many people share their .vimrc files on GitHub and I sometimes will test out settings without replacing my .vimrc file. vim allows me to do this with the -u flag.

    vim -u test_vimrc
    

    From vim ":help nocompatible"

    (Note: This doesn't happen for the system-wide vimrc or gvimrc file, nor for a file given with the |-u| argument).

    This means that if you share your .vimrc with someone and they use -u flag to load your file, vim won't be configured the same as if the file were named .vimrc and located in your home directory.

提交回复
热议问题