Ubuntu – Why does vi start vim but typing vim says vim needs to be installed

command linevim

When I type vi into terminal, VIM starts up. But when I type vim into terminal, the terminal says The program 'vim' can be found in the following packages: and lists different varieties of vim, as if I don't have vim installed. Is there a reason for this? Is the vi that comes with ubuntu not the same as VIM?

Best Answer

Well, you do have vim installed, but a minimal version of it called vim-tiny. If you run vim.tiny, you'll find it runs. This version has very few features enabled, and therefore doesn't provide the vim command. The other packages, vim-nox, vim-gnome, vim-gtk, vim-athena, have more features, and provide the vim command.

The vi command itself is actually a symbolic link, and points to whichever preferred version is installed through the Debian alternatives system. By default, since only vim-tiny is installed, the only alternative is vim.tiny, and running vi actually runs vim.tiny. If you install one of the other packages, they will become the preferred alternative for vi.

Related:

Related Question