I have a mapping to "Stamp" text over the current word that cursor is on: nnoremap S "_diwP
. When I do S
and then try to repeat it with dot .
only the last command will be repeated: P
.
Is it possible in vim to alter the mapping (somehow grouping the commands?) so that .
will repeat all of it? In other words, is it possible to repeat a compound command like "_diwP
with .
in vim?
Close to being answers:
- I know that in this particular case the command could be rewritten with
c
instead ofd
+p
. - Also the command could be recorded as a macro and repeated with
@
but that is not as convenient as using.