Like so many of the tips and tricks and hither-to unknown commands that I find in vim, I wish I have known about this years ago. There are a ton of little tricks in this short piece that are hugely useful.
One trick that I think is just the bee’s knees is *
. If you are on a word in command mode, hit *
and you will search for that word. Even better though, is the gd
trick. When the cursor is on a variable name, typing gd
will take you to the declaration of that variable.
The last thing that I think is awesome is "repeat the last change". If I am doing something repetitive, like creating an associative array of static values, I can type the first declaration and then start hitting .
in command mode until I have enough declarations for the whole array. Very sweet.