Two useful keys to remember are
a. You can combine them with
c, and other commands to manipulate text “inside” and “around” different markers.
For example, say you had a line of text like this:
| is your cursor position in normal mode) and you wanted to change the argument to an empty string. You’d just type
di', for “delete inside single-quotes,” leaving you with this:
But, you ask, what if you wanted to remove the argument entirely? Instead of
a for around—
There’s another way you could have accomplished the same, though—
`di(`, or “delete inside parentheses.
Furthermore, you can combine this with other operators like
someMethod('some '); // diw (delete inside word) someMethod('some'); // daw (delete around word)
a can be combined with other commands, to mostly obvious effect.
yi' would yank
some argument, whereas
va' would highlight
'some argument' (including the single-quotes) in visual mode.
ciw would delete the word
argument and switch to insert mode, putting the cursor after the space following
a because they’re so versatile and, with the “inside and around” mnemonic, so easy to remember.