Vim is lightweight package and its installation is really simple. In this chapter, we will discuss following items −
Vim doesn’t have any specific requirements. It is simple software bundle which provides all dependencies.
To download Vim visit vim.org
Click on Download option from left pane
Click on PC - MS-DOS and MS-Windows option
Download .exe installer from this page. At the time of writing this tutorial installer name was gvim80.exe
Double click on installer and follow on screen instructions to complete installation
Vim stores its configuration in simple text file namely _vimrc and it is located under home directory of user.
To find current user’s home directory execute below command in terminal −
$ echo %userprofile%
Navigate to home directory and create a new file namely _vimrc. Ensure that this file doesn’t have any extension.
Open this file in text editor, enter following text and save it −
set nu
Now Vim will show line numbers when file is opened. We’ll add more options to this file latter on.
Installation on Linux platform is quite simple as compared to Windows. This section describes installation and configuration on Debian based Linux.
Execute below command in terminal −
$ sudo apt-get update $ sudo apt-get install vim
To ensure Vim is correctly installed execute below command −
$ which vim
It should print the location of Vim binary. In my case it was −
/usr/bin/vim
Vim stores its configuration in simple text file namely .vimrc and it is located under home directory of user.
To find current user’s home directory execute below command in terminal −
$ echo $HOME
Navigate to home directory and create a new file namely .vimrc. Ensure that this file doesn’t have any extension.
Open this file in text editor, enter following text and save it −
set nu
Now Vim will show line numbers when file is opened. We’ll add more options to this file latter on.
This section describes installation and configuration on RPM based Linux.
Execute below command in terminal −
$ su - $ yum install vim
To ensure Vim is correctly installed execute below command −
$ which vim
It should print the location of Vim binary. In my case it was −
/usr/bin/vim
Vim stores its configuration in simple text file namely .vimrc and it is located under home directory of user.
To find current user’s home directory execute below command in terminal −
$ echo $HOME
Navigate to home directory and create a new file namely .vimrc. Ensure that this file doesn’t have any extension.
Open this file in text editor, enter following text and save it −
set nu
Now Vim will show line numbers when file is opened. We’ll add more options to this file latter on.