Vim – Why vi Shows as Vim

vim

When I type vi into a terminal it shows the following display:

vi

Note that it says vim not vi, I'm sure I haven't downloaded vim yet and that this is actually vi not vim: for example the arrow keys print ABCD instead of moving.

Best Answer

If you are using Debian then vi is opening as vim because of the entry of vi in /etc/alternatives. Let me break this up for you.

When you do ls -l /usr/bin/vi:

lrwxrwxrwx 1 root root 20 Jul  1  2014 /usr/bin/vi -> /etc/alternatives/vi

As you can see the vi binary is a symbolic link to /etc/alternatives/vi.

Now if you do ls -l /etc/alternatives/vi:

lrwxrwxrwx 1 root root 18 Jul  1  2014 /etc/alternatives/vi -> /usr/bin/vim.basic

It's a symbolic link to the binary of vim.basic.

So, in a nutshell: /usr/bin/vi/etc/alternatives/vi/usr/bin/vim.basic

As a result if you type vi in the shell, vim.basic will open.

You can check and change the values in the /etc/alternatives by the command update-alternatives but I think your original question is already answered.

Related Question