通过Emacs中的shell命令过滤文本 [英] Filtering text through a shell command in Emacs
本文介绍了通过Emacs中的shell命令过滤文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在vi [m]中有 !
命令,它允许我通过shell命令管道文本,如排序或缩进,并将过滤后的文本返回到缓冲区。在emacs中有一个等价物吗?
In vi[m] there is the !
command which lets me pipe text through a shell command -- like sort or indent -- and get the filtered text back into the buffer. Is there an equivalent in emacs?
推荐答案
您可以选择一个区域并键入`C-u M- |命令RET',并且由于shell-command-on-region的交互式前缀参数,它使用同一缓冲区中的命令输出替换该区域。
You can select a region and type `C-u M-| command RET', and it replaces the region with the command output in the same buffer due to the interactive prefix argument of shell-command-on-region.
这篇关于通过Emacs中的shell命令过滤文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文