VIM search for characters starting with ampersand -
i have search &variable
(and replace &variable.test
). \&variable
, vim shows me characters starting &variable
(&variablexxx
instance), not want. thought - /\<\&variable\>
work, please let me know going wrong.
the first problem \&
not literal &
special regex match matches branches in vim. match literal &
use &
.
the second problem \<
matches beginning of keyword looking see if next character keyword. &
not keyword fails.
to around can make &
keyword doing
set iskeyword+=&
then can use regex \<&variable\>
match things want.
relevant pages :h iskeyword
, :h /\<
, :h \&
Comments
Post a Comment