k-takata / minpac

A minimal package manager for Vim 8+ (and Neovim)
835 stars 30 forks source link

Why is nocompatible required? #117

Closed sheerun closed 3 years ago

sheerun commented 3 years ago

Here's my vimrc that works without issues:

packadd minpac
call minpac#init()
call minpac#add('sheerun/vim-polyglot')

Why is exactly nocompatible required for minpac?

k-takata commented 3 years ago

Adding set nocp in your vimrc is not necessary as I wrote in https://github.com/k-takata/minpac#basic-sample. The option will be automatically turned off when .vimrc is found. Adding the line is useful to make sure that the option becomes off even if you execute vim with the -u option and without the -N option. E.g. vim -u .vimrc.

Anyway, the 'compatible' option should be off, because setting the option on has many side effects and I don't want to support it.

sheerun commented 3 years ago

Have you considered putting set nocompatible in plugin/minpac.vim?

k-takata commented 3 years ago

Any plugin should not change the 'compatible' option.

sheerun commented 3 years ago

you can restore compatible flag after autocommands are loaded, just like vim in its autocommands: https://github.com/vim/vim/blob/master/runtime/autoload/dist/ft.vim#L755-L757

k-takata commented 3 years ago

Do you want to use minpac with 'compatible'?

sheerun commented 3 years ago

No, I don't want to set nocompatible in ~/.vimrc, and at the same time be able to use -u ~/.vimrc

sheerun commented 3 years ago

plus it would make minpac documentation shorter, no need to worry about nocompatible at all

k-takata commented 3 years ago

I think that users should always care about the 'compatible' option if they use the -u option. The user should know what they are doing.

sheerun commented 3 years ago

ok