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 express…
Thanks for your efforts with the Vis editor... 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. printf "foo\nbar\nbaz\n" | vipe - | sort # invokes $EDITOR
I should probably let dvtm fall back to vipe if it is installed. Also I will have to check whether there is an easy fix to make vipe+vis work.