This commit is contained in:
Matthew Ryan Dillon 2021-03-14 15:52:16 -07:00
parent 03f44f7dc5
commit 4830f8c1f2

47
19172b64.md Normal file
View file

@ -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
```