How to redirect stdout output to a new Vim tab?

前端 未结 3 901
灰色年华
灰色年华 2021-02-07 03:07

I\'m editing an XML file in Vim, and then I want to transform it a plain-text file with xsltproc, which by default outputs to a stdout (something like : !xsltproc TXTRULE.XSL %)

3条回答
  •  耶瑟儿~
    2021-02-07 03:56

    To expand on lucapette's answer, you could create a map like this:

    :map ,x :tabnewread !xsltproc TXTRULE.XSL #
    

    # expands to the previously opened buffer, which is the file you were editing, while % would expand to the new buffer opened by :tabnew.

    has to be used instead of |, because otherwise, the :map command would end at the |.

提交回复
热议问题