How do you use a macro to rename a variable throughout a function?
qa*Ncgn<C-r>=newName\n<Esc>q
Record a macro using * to search for the word under cursor, cgn to change the next match, type the new name.
qa*Ncgn<C-r>=newName\n<Esc>q
Record a macro using * to search for the word under cursor, cgn to change the next match, type the new name.