Redirect ex command to STDOUT in vim

前端 未结 3 1735
孤街浪徒
孤街浪徒 2021-01-19 12:35

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\' +\         


        
3条回答
  •  生来不讨喜
    2021-01-19 13:22

    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.

提交回复
热议问题