tpope/vim-abolish

Abolish search and replace fails to match things it should match?

vedantroy opened this issue · 1 comments

If I want to replace

BadJob with GoodJob

and

BADJOB with GOODJOB.

I assume the correct command with this plugin installed would be

%S/badjob/goodjob/g.

But that only replaces BADJOB with GOODJOB. It does not match BadJob at all.

tpope commented

There's nothing in your expression that tells it job is a separate word. You're expecting it to implement human intuition but sadly that's outside of scope. Something like %S/bad{,_}job/good{}job/g should work, that tells it to look for both one word badjob and two words bad_job.