如何在vim中替换~(波浪号) [英] How to replace ~ (tilde) in vim
本文介绍了如何在vim中替换~(波浪号)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有 ~ 并使用表达式的字符串
I have a string with a ~ in it and using the expression
示例:
hi~how~are~you
:%s/~/ /g
这似乎没有任何想法?
推荐答案
符号 ~
匹配上一个替换字符串(见 :help/~
),所以你需要用反斜杠作为前缀:
The symbol ~
matches the previous substitute string (see :help /~
), so you need to prefix it with a backslash:
:%s/\~/ /g
这篇关于如何在vim中替换~(波浪号)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文