Created
August 4, 2014 04:24
-
-
Save philipz/8b4e74ed396f99f34b43 to your computer and use it in GitHub Desktop.
VI 取代、替换(replace)的使用方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:s/AAA/BBB | |
更换当前所在行的第一个AAA为BBB | |
:s/AAA/BBB/g | |
更换当前行的所有AAA为BBB | |
:50,100s/AAA/BBB/g | |
更换50~100行里所有的AAA为BBB | |
:%s/AAA/BBB/g | |
修改当前行及之后全部的AAA为BBB | |
:1,%s/AAA/BBB/g | |
更换文件里所有的AAA为BBB | |
:1,%s/AAA/BBB/gc | |
更换文件里所有的AAA为BBB,唯更换前需用户确认(y同意) | |
直接回车为不更换 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment