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