From 4830f8c1f2df4b9dc9af586e606da1e4c85915cc Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 14 Mar 2021 15:52:16 -0700 Subject: [PATCH] vim note --- 19172b64.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 19172b64.md diff --git a/19172b64.md b/19172b64.md new file mode 100644 index 0000000..ef82c15 --- /dev/null +++ b/19172b64.md @@ -0,0 +1,47 @@ +--- +date: 2021-03-14T15:48 +tags: + - vim +--- + +# specifying a range when running a `!` shell command filters + +Specifying a range when running a `!` shell command filters the range through +the specified shell command by piping the range's content into the shell +command via stdin and replacing the range with the shell command's stdout. + +Running + +```vim +:1,10!sort -r +``` + +on + +``` +2 +3 +7 +1 +9 +4 +0 +8 +5 +6 +``` + +results in: + +``` +9 +8 +7 +6 +5 +4 +3 +2 +1 +0 +```