In vim, I often find that I want to add a suffix to an identifier in my source code, and then repeat it by other identifiers using ".".
i.e. to convert:
foo bar baz faz
in
foo_old bar_old baz_old faz_old
I would like to be able to:
ea_old<ESC>www
instead:
ea_old<ESC>wea_old<ESC>wea_old<ESC>wea_old<ESC>
In other words, I want to add text to the end of the word so that it appears as a repeating command in the story. Does anyone know how to do this?
I can do:
nmap <Ca> ea
to create a slightly more convenient way of adding at the end of a word, but it only repeats "a". Ideally, I want to be able to repeat the entire sequence of "eaarbitrarytext".
I have the repeat.vim plugin installed and a bit redesigned, but I really don't know what I'm doing in vimscript.
Clarification of the requirement: I want you to be able to jump using arbitrary movement commands until my cursor is somewhere on the identifier, and then click ".". to repeat adding a suffix. The above example is for a special case.
source share