My first post on unix.stackexchange.com
. Please, don't just react by the title of this post as I'm not jumping in having not researched what I'm asking for.
I have done quite a research about Vi
vs. Vim
topic. As several forums, and as also this, this or this threads speak, Vim is a superset of Vi, adding quite a lot of useful perks on top.
Confusion #1
However, right now, I'm doing a bit of in-depth Linux course (want to learn this OS better), and The Linux Foundation instructor says, that:
usually, installed program on the distribution is Vim, and Vi just links to it as an alias.
This seems plausible, as disregarding of whether I open vi or vim from my terminal, absolutely identical welcome screen launches, with identical software name, version, author and etc..
Confusion #2
However, which vim and which vi print different files from /usr/bin/
directory.
So, I'm really confused, because on one hand a lot of people speak that Vim is a superset of Vi, but on the other hand, the course I'm doing now says, that it's both Vim, and opening vi or vim, actually, almost(as they show up as identical software but behave differently) proves it.
Confusion #3
So,
Why people say, that Vi and Vim are two different programs and that Vim is a superset of Vi? as they even have identical welcome screen and version numbers, at least, on CentOS 7;
or maybe Vi is an alias of Vim specifically on CentOS 7 (which I'm using now) and usually (on other OSes) they are two different programs? but then again, they are two different binaries.. but they have absolutely identical welcome screen, which is really confusing;
If they are not different, why opening my
.java
source file is highlighted when I open it with vim and - is not, when I open it with vi?
I'm sorry if this text is a bit mashed up, but that is exactly what confuses me, as well, and what is the whole information I have gathered and observed.
They seem to be same (also are claimed by the instructor), but they are told to be different (on different forums) and they actually behave (this java file case) and show up (with which) as different.
So, what shall I understand from this?
Update:
As asked to do, vi --version
and vim --version
output this:
vi --version
:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 15 2020 16:43:23)
Included patches: 1-207, 209-629
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Small version without GUI. Features included (+) or not (-):
vim --version
:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 15 2020 16:44:08)
Included patches: 1-207, 209-629
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Small version without GUI. Features included (+) or not (-):
/usr/bin/vim
and/usr/bin/vi
respectively. – Giorgi Tsiklauri Jan 03 '21 at 01:27.java
file? – Giorgi Tsiklauri Jan 03 '21 at 01:28file /usr/bin/vi
andfile /usr/bin/vim
. They output:vi: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=9e160471d61f662dedf0d6a550962b864dc92f76, stripped
andvim: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=3dc92fe1ec8c5aa3d85b11ff67c0300b966f46b9, stripped
respectively. – Giorgi Tsiklauri Jan 03 '21 at 01:36rpm -qf /usr/bin/vi
=>vim-minimal-7.4.629-8.el7_9.x86_64
; andrpm -qf /usr/bin/vim
=>vim-enhanced-7.4.629-8.el7_9.x86_64
.-q
is for query, and-f
for Query package owning FILE, in RHEL family. So, does this mean that they are different programs but very similar? is my guess correct? how come that even versioning numbers, release dates, and everything else match then?.. – Giorgi Tsiklauri Jan 03 '21 at 01:54vim-minimal
is a stripped down version (more likevi
) without syntax-highlighting, compare the feature lists ofvi --version
andvim --version
. – Freddy Jan 03 '21 at 03:57vi
vs.vim
; however, another story is where and in what circumstances I find these two to be counterintuitive, which I explain as thoroughly as I can. Thank you for your points, but I don't think I agree with them, and my question doesn't violate "one question per post". Your second point is unclear. – Giorgi Tsiklauri Jan 04 '21 at 21:54