In most of operating systems by default vim syntax colouring is enabled.
Syntax coloring will help us while editing .java, .html, and .py etc…
In your operating system if the syntax coloring is not enabled by default you need to do small change in your vimrc file as explained below.
- open your vimrc fine with any editor. You need root permissions to edit it.
sudo vim /etc/vim/vimrc
- Now search for keys “syntax highlighting”, the lines look like below.
" Vim5 and later versions support syntax highlighting. Uncommenting the next
” line enables syntax highlighting by default.
- The line syntax on is commented with
", remove comment by removing
". It should looks like below.
- syntax on
- Now save and exit the vimrc file. Also check your by editing some file.