VIM

Vim, short for Vi IMproved is an advanced text editor that is an extended version of the vi editor. Often considered a "programmer's" editor, vim offers many advanced features and capabilities for editing, document navigation and works well as an IDE. Mouse selection support also makes it a great editor to use remotely on your server.

Installing

Vim can be easily installed to your CentOS or Redhat Linux server via the yum package manager. To take advantage of the most useful features, you'll need to install the 'vim-common', 'vim-minimal', and 'vim-enhanced'.

yum install vim-common vim-minimal vim-enhanced

Vim can be launched simply with the command 'vim'.

Set as Default Editor

Some programs or scripts may relay on the current EDITOR environmental variable to determine how to present a file to be modified. Usually, this will default to 'vi' or 'nano'. To change this, simply set the EDITOR variable in your .bashrc file.

echo export EDITOR="/usr/bin/vim" >> ~/.bashrc

You will need to log out, and back in for this to take effect.

Usage

Basic usage is the same as the vi editor, which you can find information on in our vi Text Editor article. Additional guides on the more advanced features Vim offers will be provided.