I want a quick macro to allow me to convert text like qty_on_hand to Qty_On_Hand. Words that have no underscores should be capitalised so description would become Description. Case in the source text is not going to be consistent, so it might be QTY_on_Hand -> Qty_On_Hand.
Any ideas?
Try the following:
Then when you type
@t
in normal mode you will get current word replaced as you requested. If you want to just blindly replace everything, then useAdd
c
afterg
flag if you want vim to ask you about each replacement.Second solution assumes that there are no non-ASCII identifiers in your source code.