If I start vim in Ex-mode, I can have it print the entire file with
You can do this by combining two tools:
:TOhtmlgenerates an HTML file that contains syntax highlight.
elinksprints the HTML file into the terminal with colors. See this post.
:TOhtml, so Vim created
I go to the terminal and type this:
elinks -dump -dump-color-mode 3 ~/test_vimrc.vim.html
Then I see this:
You need to test which color mode works in your terminal. For me 2 and 3 work, but the background is gray if I use 1 or 4. Also, within tmux, it it always gray: