Using external formatting tools

Even though experienced Vim users often say that Vim can do everything, this is of course not the truth—but is close. For those things that Vim can't do, it is smart enough to be able to use external tools.

In the following sections, we will take a look at some of the most used external tools that can be used for formatting your code, and how to use them.


The Indent program is probably one of the most used external programs for Vim. It has been around since the late 80s for various Unix platforms, and has also later been imported to other platforms including Microsoft Windows.

As the name indicates, this program indents code—especially the code that resembles the C code in syntax. What you may wonder is why ...

Get Hacking Vim 7.2 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.