是否可以将shell命令的输入和输出重定向到vim ?
预期的行为与Emacs shell-command-on-region类似,用于输入并将输出重定向到缓冲区,就像emacs一样。输入和输出缓冲区是不一样的。
发布于 2018-10-12 20:50:20
基于这一描述的shell-command-on-region
M-|cmd<RET>运行shell命令cmd,将区域内容作为输入;可以选择用输出(shell-command-on-region)替换该区域。
以选定的行作为输入运行命令的内置方式是:help :w_c。
:[range]w[rite] [++opt] !{cmd}
Execute {cmd} with [range] lines as standard input
(note the space in front of the '!'). [...]用命令的输入替换所选内容的内置方式是:help !。
:{range}![!]{filter} [!][arg] *:range!*
Filter {range} lines through the external program
{filter}. [...]这两种方法都有一些可供选择的方法,在阅读帮助部分时不要害怕滚动。

https://stackoverflow.com/questions/52786244
复制相似问题