:%s/oldword/newword/g
That's how I usually do it. Now, I want to replace abc.com
with <%= domain %>
. How can I do that? (The symbols don't work when you type them in vim command line)
:%s/abc.com开发者_运维百科/<%= domain %>/g
You need to escape .
(so that it does not match any character) and %
. Try this:
:%s/abc\.com/<\%= domain \%>/g
You must escape the '.' and '%' characters. Like this :%s/abc\.com/<\%= domain \%>/g
精彩评论