开发者

How do I replace this text in VIM?

:%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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜