Vim is text editor for Linux. Its name stands for “Vi improved”, Vi being an older editor, of course. Every serious Linux geek will edit and navigate text documents, write notes and code using Vim.
To install Vim on your CentOS or Redhat Linux type this in your terminal:
yum install vim-common vim-minimal vim-enhanced
The above will install Vim with a good set of features.
Setting Vim as the default editor
The EDITOR environmental variable specifies the default editor, i.e. the application used by programs for viewing / editing files when there’s no pre-defined editor. To make Vim your default editor, se the EDITOR variable by editing your .bashrc file:
echo export EDITOR=”/usr/bin/vim” >> ~/.bashrc
remember to log out and log back in to make the changes take effect.
Vim is identical to vi editor in basic usage, while advanced functions will be explained in a future article