In the video, I demonstrate that A
plays better with the .
command than it’s longhand equivalent: $a
. The dot command replays the last edit, but it does not replay motions such as $
. The A
command compresses the move to line end motion with the append command into a single edit, making the motion implicit, and therefore repeatable with the .
command.
The video also demonstrates that c{motion}
is a contraction of d{motion}i
. Having implicit motion means that the c
command also plays well with the dot command.
Implicit motion command | Longhand equivalent |
---|---|
c{motion} |
d{motion}i |
C |
d$a |
s |
xi |
S |
^C |
I |
^i |
A |
$a |
o |
$a<CR> |
If you are doing a repetitive task, then composing your brush strokes so that they can be replayed with the dot command can save you a lot of time. Learning these ‘implicit motion commands’ will enable you to exploit the dot command to its fullest.
Further reading
:help vim-modes
:help u
:help ctlr-r
:help .
- Graphical cheat sheet - commands marked in red enter insert mode