vim 常用命令

查找替换

1 :%s/search_for_this/replace_with_this/
上面的命令只替换一次,替换第一次查找到的目标
search_for_this:要查找的目标
replace_with_this:替换成该单词
1 :%s/search_for_this/replace_with_this/c   - confirm each replace

c表示替换前要求确认

1 :%s/search_for_this/replace_with_this/g

g表示全局替换

原文地址:https://www.cnblogs.com/vdvvdd/p/10143064.html