October 2015
Intermediate to advanced
356 pages
7h 54m
English
| Tip 35 | Run Commands in the Shell |
We can easily invoke external programs without leaving Vim. Best of all, we can send the contents of a buffer as standard input to a command or use the standard output from an external command to populate our buffer.
The commands discussed in this tip work best when used from Vim inside a terminal. If you’re using GVim (or MacVim), then things may not work quite as smoothly. That shouldn’t come as a great surprise. It’s much easier for Vim to delegate work to the shell if Vim itself is already running inside a shell. GVim does some things better, but this is one area where terminal Vim has the edge.
From Vim’s Command-Line mode, we can invoke external programs in the shell by ...