VIM how to replace “AA” to “BB” in a file
问题 I need to replace a file which has thousand of lines code. In the log, it has a specific word which I want to replace this work with some other words. Say, how to replace all "AA" to "BB" in this file? thanks 回答1: You want to use :%s/\<AA\>/BB/g % specifies that you want to replace on all lines. s tells vim that you want to do a substitution Between the first / and second / is what you want to replace (ie \<AA\> ). The \< and the \> are word boundaries , making sure that AA is matched but fAA