Vim : .vimrc configuration

Apart from customising vim each time, we can also make our changes permanent. So that each time we open vim, we get our customised vim. To do that, we need to create .vimrc file in home directory of current user. Each time vim starts it looks for .vimrc file and loads it. 

So how to set commands in .vimrc configuration file. Well, it's pretty easy, all you have to do is write those commands but this time without colon (:). It mean while we are working in vim editor we need to type :set nu to show line number. The same command you can write in .vimrc without colon. So in .vimrc you have to write set nu. 

In .vimrc, you can also write comments line, followed by ( " ) opening double quote. You can also map a key to any snippet.

Here is my settings:

"remap single open brackets to both opening and closing
inoremap " ""<left>
inoremap ' ''<left>
inoremap ( ()<left>
inoremap [ []<left>
inoremap { {}<left>

"show line number
set nu  

"show relative line number
set rnu 

set noswapfile
set cursorline
set tabstop=4
set history=100
set scrolloff=10
set ruler
syntax on
set showmode
set autoindent
set foldcolumn=4
set foldlevel=2
set foldmethod=indent
set foldclose=all

Comments