How do I change until the next underscore in VIm?
- by Nathan Long
If I have this text in vim, and my cursor is at the first character:
www.foo.com
I know that I can do:
cw to change up to the first period, because a word (lowercase w) ends at any punctuation OR white space
cW to change the whole address, because a Word (uppercase w) ends only at whitespace
Now, what if I have this:
stupid_method_name
and want to change it to this?
awesome_method_name
Both cw and cW change the whole thing, but I just want to change the fragment before the underscore.
My fallback technique is c/_, meaning 'change until you hit the next underscore in a search,' but for me, that also causes all underscores to be highlighted as search terms, which is slightly annoying.
Is there a specifier like w or W that doesn't include underscores?