Redirect ex command to STDOUT in vim

前端 未结 3 1763
孤街浪徒
孤街浪徒 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:15

    I ran into this by mistake while running your first command. The second time I ran it, it went to stdout. I guess this is because the file already existed. So you can try (sending to something that already exists):

    vim +'redir >/dev/null' +'hi' +'redir END' +'q'
    

提交回复
热议问题