Linux中vim替换字符命令的使用(shell编程)

it2023-05-23  70

1. 在vim中 :s(substitute)命令用于查找并替换字符串;

使用方法

:s/<find-this>/<replace-with-this>/<flags>

2. 例如,在vim中想将11行中的a批量替换成b:

11行  printf("a",a);

执行命令 :11s/a/b/g 

结果:printf("b",b);

 

相关文章推荐:

https://www.cnblogs.com/chester-cs/p/11605656.html

 

最新回复(0)