Show HN: Vi-pipe, edit and replay text changes in the middle of a shell pipeline
github.com
github.com
It was only after squinting for a bit and mentally parsing the example code that I had the a-ha moment and understood when/why I'd want to use this though. Maybe a video or asciicinema/terminalizer recording showing how it works in practice might help illustrate
hopefully the examples in the readme make sense but maybe not?
beginning of pipeline > output.txt; <editor of choice> output.txt; cat output.txt | rest of pipeline commands
sed, stream editor, takes text from standard in and writes changes to standard out in the middle of a pipeline. sed does this without all the extra overhead a standard editor incurs.
More flexibility with awk, but also more overhead than sed, but less than vim.
With a bit of macro magic and/or readning from/writing out to named pipe, can do the same interactively with vim.