For a long time I've known that I can use ~ in Vim to toggle the case of a character. But is there a way to map a key to capitalize a word and go back to the previous position?
For example:
I like to drink Coca co[l]
If my cursor is at "l" and I realize I need to make the "c" capitalize as well, currently, I need to do:
<C-c> b ~ ll i
Is there a way to map a single key to make the first letter of the word under cursor to be capitalized and keep the cursor at original position?
:nmap <whatever> m`b~``
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With