Table of Contents

Vim tips and tricks

vimrc

Below I have listed some settings in vim which make your editing life easier.

set nobackup
set nonumber
set showmatch
set tabstop=6
set expandtab
set ai
set linebreak
set wrap wrapmargin=4
nmap  j gj
nmap  k gk
nmap gqap <F8>

Comment selected lines

Visually select the lines you want to comment using CTRL + v. Then press semi-colon “:” which will give you

:'<,'>

Then type

:'<,'> s/^/#

Links

1) Sometimes you may need a tab, like in a makefile