Five vim tips for your week

Vim is awesome, fun and powerful! Vim has lots of hidden features that we don't use. Every monday, we send 5 tips that can help boost your vim productivity you can think of it as one tip per day!

View Archives
Past issues of vim-weekly
code environment

Issue #16 - June 28th 2014

Tip 1

auto (re)indent entire document


Source: vim wikia

Tip 2

Send lines 1 - 12 to the printer, omitting the range will cause the entire document to be printed


Source: vim manual

Tip 3

As above, but write the resulting PostScript in file 'fancy_pdf'. Please note that this is only available when vim is compiled with the +postscript feature

:1,12ha! > fancy_pdf

Source: vim manual

Tip 4

Open man page for word under cursor


Source: tawheed

Tip 5

Set the shell Vim uses for external commands to bash in such a way that it'll source ~/.bash_profile

set shell=/bin/bash --login

Source: dotvimrc