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 ...