Execute current line in Bash from Vim

后端 未结 7 1882
误落风尘
误落风尘 2020-12-12 11:58

This question is similar to Vim: execute current file?, but instead of executing the current file I want to execute only the current line.

Is this possible?<

相关标签:
7条回答
  • 2020-12-12 12:50

    Sure thing, you can 'write' any content of the current file into the standard input of another program:

    :.w !bash
    

    Here . (the part before w) refers to the range of lines you are writing, and . is only the current line. Then you use !bash to write those lines to Bash.

    0 讨论(0)
提交回复
热议问题