0

I know this must seem stupid... however I've just wasted like 2 hours trying to get vim-plug working. I am on CentOS7. I type vi and it brings up vim 7.4.160. I typed vim and I get vim: command not found. After faffing about for ages and searching on google as I could not get the plugin manager to work, I finally did yum install vim. And it did. Typing vi and the plugin manager still did now work. Finally now I type vim and the plugin manager works. vi and vim commands with no args brings up the exact same VIM - Vi IMproved banner and exact same versions. At this point I am just curious as to what is going on in the background to cause this behavior.

  • perhaps it is this? vim checks argv[0]. If that is vi, it runs in compatibility mode. – William Dossett Mar 10 '18 at 18:22
  • Installing Vim usually provides a vim command as well as a vi command that is a symbolic link to vim. Maybe the new symbolic link vi is earlier on your $PATH than the other vi you used previously. – tommcdo Mar 10 '18 at 23:58
3

If you want to run Vim, then type vim. ☺

On a more serious note, most of the Linux distributions provide different builds of Vim, with varying feature levels (i.e., the --with-features=... argument when running ./configure), GUI support, and enabled language bindings. Speaking with my Debian maintainer hat on, I provide these packages:

  • vim-tiny: small features, only provides the vi binary, intentionally runs with 'compatible' set, no language bindings, no X/GUI support
  • vim: huge features, no language bindings, no X/GUI support
  • vim-nox: huge features, all language bindings except Racket, no X/GUI support
  • vim-gtk/gtk3/athena: huge features all language bindings except Racket, X/GUI support

In Debian land, you can have more than one of the packages above installed and can use the alternatives system (via the update-alternatives command) to decide which one is used when typing vi, vim, gvim, etc.

It sounds like there's a similar set of packages in CentOS land. I'm not sure if there's something similar to the alternatives system, which would let you configure what vi runs, or if vi is only provided by the vim-minimal package. I think it's the latter since I seem to recall that when you install the package that provides a GUI, you have to run vimx to run that binary in the terminal.

As far as what the actual differences are between the different binaries, you should be able to get a high-level overview from your package manager. You can also ask Vim to tell you. Compare vi --version to vim --version.

  • what is the reason for not including the Racket binding? – Christian Brabandt Mar 12 '18 at 9:08
  • @ChristianBrabandt 1) It doesn't build on all the architectures in Debian, so I would need to maintain a list of where to enable it. 2) The SONAME changes every release, so Vim would have to be rebuilt every time. 3) Due to 2, the Debian packages don't currently provide a shared library to build against. 4) No one has ever requested adding that support to Debian's packaging. – jamessan Mar 13 '18 at 3:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.