Vi is a text editor that comes preinstalled on CentOS distributions. Anyway, the Vi version that is installed is vim-minimal. You can check which version you have with the vi –version command:
root@www [/]# vi --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 9 2019 03:16:06)
Included patches: 1-207, 209-629
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Small version without GUI. Features included (+) or not (-):
............
You can see the text “small version without GUI”. The command will also list all the available options of the software. If you want more features available you need the Vim enhanced version, vim-enhanced.
We check first which version is available in the yum repository:
root@www [/]# yum info vim-enhanced
Loaded plugins: fastestmirror, tsflags, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 208.74.123.61
* cpanel-addons-production-feed: 208.74.123.61
* cpanel-plugins: 208.74.123.61
* base: mirror.us.oneandone.net
* epel: mirror.compevo.com
* extras: mirror.us.oneandone.net
* updates: mirror.us.oneandone.net
Installed Packages
Name : vim-enhanced
Arch : x86_64
Epoch : 2
Version : 7.4.629
Release : 6.el7
Size : 2.2 M
Repo : installed
From repo : base
Summary : A version of the VIM editor which includes recent enhancements
URL : http://www.vim.org/
License : Vim
Description : VIM (VIsual editor iMproved) is an updated and improved version of the
: vi editor. Vi was the first real screen-based editor for UNIX, and is
: still very popular. VIM improves on vi by adding new features:
: multiple windows, multi-level undo, block highlighting and more. The
: vim-enhanced package contains a version of VIM with extra, recently
: introduced features like Python and Perl interpreters.
:
: Install the vim-enhanced package if you'd like to use a version of the
: VIM editor which includes recently added enhancements like
: interpreters for the Python and Perl scripting languages. You'll also
: need to install the vim-common package.
So, to install VIM use:
yum install –y vim-enhanced
root@www [/]# yum install –y vim-enhanced
Loaded plugins: fastestmirror, tsflags, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 208.74.123.61
* cpanel-addons-production-feed: 208.74.123.61
* cpanel-plugins: 208.74.123.61
* base: centos.host-engine.com
* epel: fedora-epel.mirror.lstn.net
* extras: ftpmirror.your.org
* updates: centos.mirrors.hoobly.com
Resolving Dependencies
--> Running transaction check
---> Package vim-enhanced.x86_64 2:7.4.629-6.el7 will be installed
--> Processing Dependency: vim-common = 2:7.4.629-6.el7 for package: 2:vim-enhanced-7.4.629-6.el7.x86_64
--> Running transaction check
---> Package vim-common.x86_64 2:7.4.629-6.el7 will be installed
--> Processing Dependency: vim-filesystem for package: 2:vim-common-7.4.629-6.el7.x86_64
--> Running transaction check
---> Package vim-filesystem.x86_64 2:7.4.629-6.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
vim-enhanced x86_64 2:7.4.629-6.el7 base 1.1 M
Installing for dependencies:
vim-common x86_64 2:7.4.629-6.el7 base 5.9 M
vim-filesystem x86_64 2:7.4.629-6.el7 base 11 k
Transaction Summary
========================================================================================================================================================================
Install 1 Package (+2 Dependent packages)
Total download size: 7.0 M
Installed size: 23 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): vim-enhanced-7.4.629-6.el7.x86_64.rpm | 1.1 MB 00:00:00
(2/3): vim-filesystem-7.4.629-6.el7.x86_64.rpm | 11 kB 00:00:00
(3/3): vim-common-7.4.629-6.el7.x86_64.rpm | 5.9 MB 00:00:01
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 6.8 MB/s | 7.0 MB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 2:vim-filesystem-7.4.629-6.el7.x86_64 1/3
Installing : 2:vim-common-7.4.629-6.el7.x86_64 2/3
Installing : 2:vim-enhanced-7.4.629-6.el7.x86_64 3/3
Verifying : 2:vim-enhanced-7.4.629-6.el7.x86_64 1/3
Verifying : 2:vim-common-7.4.629-6.el7.x86_64 2/3
Verifying : 2:vim-filesystem-7.4.629-6.el7.x86_64 3/3
Installed:
vim-enhanced.x86_64 2:7.4.629-6.el7
Dependency Installed:
vim-common.x86_64 2:7.4.629-6.el7 vim-filesystem.x86_64 2:7.4.629-6.el7
Complete!
root@www [/]#
As you can see, the command will also install the required packages vim-filesystem and vim-common.
Notice that the basic editor will remain. You will access the basic Vi with the command vi and the enhanced Vi with the vim command.
Resources:
Vim – the ubiquitous text editor