On Wednesday, March 22, 2017 at 2:56:26 PM UTC-5, rafaeln wrote:
> In operator mode, gn becomes very useful far batch operations. For instance, 
> dgn can be repeated with . to delete multiple instances of a match. However, 
> ygn can't be repeated with . to yank multiple instances of a match. That by 
> itself would be useless, of course, since it only amount to overwrite the " 
> register with the last match. In conjunction with an uppercased register, 
> however, the command would allow one to collect all the matches into the same 
> register. Say, you first clean a register—for concreteness, register "a—with 
> qaq, then you execute "Aygn to copy the first instance of a match into the 
> register and would like to be able to repeat the command with . to keep 
> collecting all matches into the same register. That doesn't work, though. 
> Even though . repeats the command, the cursor never jumps to the next match, 
> and all you end up doing is copying the same instance of a match over and 
> over into the same register. I started vim with vim --cmd 'set 
> rtp=$VIMRUNTIME' --cmd 'se nocp cpo+=y' -u NONE
> 
> 

Are you sure it repeats the command? I don't expect '.' to repeat a yank 
command, ever. I would consider it a bug if it did!

I did just test and for me the '.' command does *not* repeat a yank. For 
example with the following text, search for /abc\+d and use ygn followed by p 
followed by ygn and then move the cursor to another match and press '.'. The 
paste is repeated as expected, not the yank:

abcd abccccd abccd abd abcccccccd

You can do exactly what you want by recording a macro, however.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui