|
|
|
|
|
by martanne
3732 days ago
|
|
Vim is actually a relatively bad filter (some reasons are mentioned in the caveats section of the article). I explicitly designed my vis editor[1] in such a way that it can be used as an interactive filter. The following works as expected, use :wq to write to stdout: printf "foo\nbar\nbaz\n" | vis - | sort
dvtm uses this mechanism to implement its copy mode.I also recently integrated sam's structural regular expression based command language into the editor. This might be useful for people who want the power of stream editors but with instant visual feedback. However keep in mind that this feature is relatively new thus likely still contains some bugs ... [1] https://github.com/martanne/vis |
|
You can do this with any other editor using "vipe" from "moreutils" package. It just opens $EDITOR with stdin input (put to a tempfile) and then reads the tempfile and dumps it in stdout.