@RussSharek Wait, but doesn't tilde *flip* the case of letters? So it doesn't replace gU and gu for anything that's mixed case, which is *most* of my usage for those.
Or am I missing something?
@RussSharek Wait, but doesn't tilde *flip* the case of letters? So it doesn't replace gU and gu for anything that's mixed case, which is *most* of my usage for those.
Or am I missing something?
@[email protected] setting tildeop would be more like g~ but you can also pipe ranges of lines to tr(1) or rot13(6)/caesar(6) for things like gU: :'a,'b!tr a-z A-Z gu: :'a,'b!tr a-z A-Z and g?: :'a,'b!rot13 :'a,'b!caesar 13 (though it's more challenging for things like word-wise or sentence-wise transformations)
You're right, it flips them. In my enthusiasm for a new (to me) tool I only focused on a simpler use case which I needed. I often need to capitalize an entire line, and letting ~ accept counts and motions was a win for me.
I see a few helpful friends chimed in with some other answers. I found this method, which could be mapped to keys:
Lowercase
:%s/pattern/\L&/
Uppercase
:%s/pattern/\U&/