It should be clear by now that Vim is a very powerful text editor but don’t be fooled, it doesn’t do everything. Sure we get a lot of small low-level elements to play with but, sometimes, using a specialized tool would be more suited to the job. After all, Vim shares its environment with many commandline tools so…​ why not putting them to good use?

In this chapter we will see how Vim interacts with its environment and how we can leverage this environment to…​

With Vim, we can run external commands in — broadly speaking — two ways: as filters and, well, as external commands.


Transforming existing text in place with another program is called filtering: we feed some text from our buffer to a “filter” and we replace that text with the output of that filter.

External commands

As should be obvious by now, Vim can do a lot and gives us plenty of means and opportunities to build higher-level tools to suit many needs.

We have seen how to use options, mappings and custom commands to customize Vim’s behavior but there are times when

~/.vim/ and its structure