从 shell 交互式搜索和替换 [英] Interactive search and replace from shell
本文介绍了从 shell 交互式搜索和替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Search and replace over multiple files is difficult in my editor. There are plenty of tricks that can be done with find
, xargs
and sed
/awk
incluing search-and replace in multiple files. But somehow I couldn't find a way to make this interactive. Do you know a way to do that?
解决方案
KISS principle:
vim
:args `ls`
:argdo %s#SEARCH#REPLACE#gec |update
First character afer %s is used as separator
这篇关于从 shell 交互式搜索和替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文