From 534fa231b3b5bac5574a88b21dcfa936666b67f8 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Wed, 27 Jan 2016 13:50:54 +0100 Subject: [PATCH] Filters: :r! vs !! --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 42ea891..b615e00 100644 --- a/README.md +++ b/README.md @@ -1544,9 +1544,14 @@ A good use case for filtering is the [Go programming language](https://golang.org). The indentation is pretty opiniated, it even comes with a filter called `gofmt` for indenting Go source code properly. So plugins for Go often provide helper commands called `:Fmt` that basically do -`%!gofmt`, so they indent all lines in the file. +`:%!gofmt`, so they indent all lines in the file. -Related help: `:h filter` +People often use `:r !prog` to put the output of prog below the current line, +which is fine for scripts, but when doing it on the fly, I find it easier to use +`!!ls` instead, which replaces the current line. + + :h filter + :h :read! #### MatchIt