Tips for golfing in vim I've recently realized how vim works great for golfing, especially for kolmogorov-complexity. Also, according to meta vim is a perfectly acceptable 'programming language' at least, for the scope of this site, that is.

What general tips do you have for golfing in Vim? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Vim (e.g. "remove comments" is not an answer).

Please post one tip per answer.
Be aware of the uppercase variants of common commands. This can trivially save one keystroke in a lot of contexts. For example:

A = $a
C = c$
D = d$
I = ^i
S = cc
X = dh
Y = yy


Another one is to use G instead of gg, but only if you use a count! For example, without a count, gg moves to the beginning, and G moves to the end. However, with a count, they both move to the line you specify, so 5G is shorter than but equivalent to 5gg
    .

Another one, is to use H in place of gg, but it's important to note that this only works if you can guarantee that any input will not take up more than the default number of rows (I believe this is 24, but it may vary).