I\'m trying to craft a command to dump vim\'s highlighting information to STDOUT. I can write successfully to a file like this:
vim +\'redir >outfile\' +\
If you're working with Unix compatible environment, you can always use a special file, e.g.:
ex +"redir>>/dev/stdout | hi | redir END" -scq!
This will print any Vi/Ex command into standard output which you can parse further.