vimtricks.wiki Concise Vim tricks, one at a time.

How do you pipe buffer contents to a shell command?

Answer

:%!sort

Explanation

Use :%!command to filter the entire buffer through a shell command. :%!sort sorts all lines. Use visual selection for partial filtering.

Next

How do I visually select a double-quoted string including the quotes themselves?