Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sentriz/vi-pipe
edit text in the middle of a shell pipeline, and store a diff to replay changes after further invocations
https://github.com/sentriz/vi-pipe
Last synced: 3 days ago
JSON representation
edit text in the middle of a shell pipeline, and store a diff to replay changes after further invocations
- Host: GitHub
- URL: https://github.com/sentriz/vi-pipe
- Owner: sentriz
- Created: 2022-07-26T22:11:58.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-14T15:06:33.000Z (about 2 years ago)
- Last Synced: 2024-12-27T17:04:20.864Z (6 days ago)
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
vi-pipe
edit text in the middle of a shell pipeline, and store a diff to replay changes after further invocations
---
### installation
```
go install go.senan.xyz/vi-pipe@latest
```### usage
```
export EDITOR=vi
vi-pipe [-re]
```### example
```shell
# there are a lot of possibilities with this thing
# for example list some files, clean them up or prune them in the editor, then delete them
$ ls ~/my-files | vi-pipe | xargs rm# changes are kept, so long as the current directory doesn't change
$ echo a | vi-pipe
ab # only added the "b" char in editor
$ echo a | vi-pipe
abc # only added the "c" char in editor, previous change pre-applied# manipulate some data
$ cat people.csv | csv-to-json | jq '.[] | .address'
# oops, no jq output. this csv has no header row, let's add it in the editor
$ cat people.csv | vi-pipe | csv-to-json | jq '.[] | .address'
Dublin, Irenand
Barcelona, Spain
# nice, but there's a typo. let me re-open in the editor. there'll be no need to add the header again
$ cat people.csv | vi-pipe -re | csv-to-json | jq '.[] | .address'
Dublin, Ireland
Barcelona, Spain
```