How to write buffer content to stdout?

后端 未结 9 1766
执笔经年
执笔经年 2020-12-09 01:54

Is there any chance to write the content of the current vim buffer to stdout?

I\'d like to use vim to edit content that was passed via stdin - without the need of a

9条回答
  •  南笙
    南笙 (楼主)
    2020-12-09 02:15

    Using :print will write to stdout, particularly if vim is run with both the -E and -s options, which cause it to run noninteractively and silently. See :h -E and :h -s-ex:

    The output of these commands is displayed (to stdout):
                            :print                          
                            :list
                            :number
                            :set      to display option values."
    

    Use :%print to print the whole current buffer.

提交回复
热议问题