开发者

Can you write unescaped search terms in the Vim command line?

When I do a search and replace on a yanked line that has characters that require escaping it's really annoying to have to go back through the command line string and escape all the special characte开发者_JS百科rs.

Is there a way to use a literal (raw) string modifer like in python: str = r'\unescaped\'?


Use the \V modifier:

:%s/\V$foo//g

See also :help /magic


I just thought of doing this instead: :%s;\foo\;bar;g. This solves the escape the backslash problem Manni points out.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜