Say I've entered insert mode by typing 4s -- removing four characters from
the current cursor position and leaving me in insert mode. Is there a
built-in means of repeating this?

Use case:
I have one line of text like:

    private EntryReader xmlEntryReader;

I want to add 3 new entries with the result:

    private EntryReader xmlEntryReader;
    private EntryReader nativeEntryReader;
    private EntryReader binaryEntryReader;
    private EntryReader jsonEntryReader;

My instinct is to do a yyppp on the first line (xmlEntryParser) giving me

    private EntryReader xmlEntryReader;
    private EntryReader xmlEntryReader;
    private EntryReader xmlEntryReader;
    private EntryReader xmlEntryReader;

then use search (/xml<CR>) and n to position my cursor sequentially on the
beginnings of the words I want to change, doing each edit along the way. So
I would type (with the cursor on the first xmlEntryReader)

   n3snative<ESC>n3sbinary<ESC>n3sjson<ESC>

What I'm looking for is a way to avoid typing "3s" each time. Is the
previous entry-into-insert method stored anywhere? Maybe the previous normal
command? I know I can repeat edits with . and I use this constantly (I
actually have "n." stored in the @n register by default so that i can repeat
find-next/repeat-edit by macro which I highly recommend!). I'm looking for
basically the same thing but without the actual editing being repeated (nor,
of course, the exit from insert mode)

Any thoughts would be greatly appreciated! This comes up for me surprisingly
often...
-- 
Christopher Suter
www.grooveshark.com

-- 
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

Reply via email to