guillermooo / Vintageous

Vi/Vim emulation for Sublime Text 3
http://guillermooo.bitbucket.org/Vintageous/
Other
1.64k stars 115 forks source link

search and replace whole word is not working #1032

Closed jasjuang closed 8 years ago

jasjuang commented 8 years ago

For example

test

ttttest

:%s/\<test\>/zz/g 

does nothing, please look into it, thank you so much

On the side note

:%s/test/zz/g 

works but ttttest got modified to tttzz

simple search like

/\<test\> 

works fine too

deconvolved commented 8 years ago

Vintageous hands off to Python for substitution, which uses a regex syntax that is not fully compatible with that used by vim. Based on a previous post, I don't believe there are currently any plans to fully support vim-style regex.

You should be able to achieve the same result in ST by using \b in place of the escaped angle brackets. For example :%s/\btest\b/zz/g in place of :%s/\<test\>/zz/g.

jasjuang commented 8 years ago

Thanks for the clarification. \b works.