Color your coding world — VIM specs

Shivendra Pratap Kushwaha
3 min readJun 21, 2020

--

Isn’t It boring to see the same black and white screen of vim editor? Do you also think of switching to some of the IDE’s like VB Studio, Eclipse, Atom etc. but you have no other option because ‘Abba nahi manenge!!’ (your company won’t allow you😝). So let’s get forward and convert your black and white screen to a colorful and easy to use window.

Starting with the General specifications of the OS and Vim version I will be using for demo, as there might be some of the features which might not work with you depending on the version. But I hope we will have at least some of the cool features working at the end of this Blog.

But First let me introduce you to the boring version of the vim. I have created a Python file and lets see how it looks:

Mac OS : Darwin (Unix like OS made by Apple Inc.)
Vim version : VIM — Vi IMproved 8.1 (2018 May 18, compiled Feb 29 2020 00:47:39)
Default TERM — xterm-256color

I recommend you to export TERM:
export TERM=dtterm

Now we will create a file .vimrc in home directory. All the settings will be applied from this file.
vim ~/.vimrc

Add these lines to the file and save:
syntax enable
set expandtab
set tabstop=4
set shiftwidth=4
set number
filetype indent on
set autoindent
set laststatus=2
set statusline=[%n]\ %<%f%n%m
set showmatch
let python_highlight_all=1
set cursorline

Explanation for all the settings used are given below:

set expandtab — To insert space characters whenever the tab key is pressed
set tabstop — To control the number of space characters that will be inserted when the tab key is pressed
set shiftwidth — To change the number of space characters inserted for indentation
set number — To show a column of sequential line number
filetype indent on — To enable loading the indent file for specific file types
set autoindent — To automatically indent the next new line to match the indent of the previous one
set laststatus — To display the status line always
set statusline — To show specification of the file in a status line on the bottom.
set showmatch — To show matching bracket while typing
let python_highlight_all — to enable all syntax highlighting features
set cursorline — to highlight the current line in every window

So… We are all set. Let’s reopen the same python file and see the magic.
3…2…1…BOOM!!…

Great… Thats it… Hope you will enjoy your colorful coding now on.

--

--