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