From 0d9148232346f168de4b4c7d3ef36105f00ccd7e Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Tue, 11 Aug 2015 23:04:49 -0500 Subject: [PATCH] Add Filter Lines Through An External Program as a vim til. --- README.md | 1 + ...ilter-lines-through-an-external-program.md | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 vim/filter-lines-through-an-external-program.md diff --git a/README.md b/README.md index 352aef5..aef6c8b 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [Create A New File In A New Directory](vim/create-a-new-file-in-a-new-directory.md) - [Edges Of The Selection](vim/edges-of-the-selection.md) - [End Of The Word](vim/end-of-the-word.md) +- [Filter Lines Through An External Program](vim/filter-lines-through-an-external-program.md) - [Generate and Edit Rails Migration](vim/generate-and-edit-rails-migration.md) - [Head of File Name](vim/head-of-file-name.md) - [Help For Non-Normal Mode Features](vim/help-for-non-normal-mode-features.md) diff --git a/vim/filter-lines-through-an-external-program.md b/vim/filter-lines-through-an-external-program.md new file mode 100644 index 0000000..db1a3d4 --- /dev/null +++ b/vim/filter-lines-through-an-external-program.md @@ -0,0 +1,20 @@ +# Filter Lines Through An External Program + +Vim allows you to filter lines from your current buffer through an external +program. For instance, if you have some ugly looking json that you'd like to +format in a readable way, you might want to filter it through an external +json pretty printer program. + +To filter the entire file through an external program, use + +``` +:%!! +``` + +Or you can make a visual selection and just filter that + +``` +:'<,'>!! +``` + +See `:h !!` for more details.