Is there a way to open screen's terminal scrollback buffer in vim?
From within a Screen window, run
screen -X hardcopy -h s
vim s
rm s
hardcopy -h
dumps the scrollback into a temporary file which you can then open in Vim if you like. If you script this you should use a proper temporary file name:
#!/bin/sh
scrollback_file=$(mktemp)
screen -X hardcopy -h "$scrollback_file"
vim -c 'call delete(@%)' "$scrollback_file"
(Or you could just run your shell in Emacs or in Neovim.)