"C-r" in visual mode "r" command

Frank Fischer frank.fischer at mathematik.tu-chemnitz.de
Fri Sep 23 19:44:52 CEST 2011


Am Fri, 23 Sep 2011 10:36:18 -0400
schrieb York Zhao <gtdplatform at gmail.com>:

> > I do not know why you expect this behavior. The "r" command replaces
> > the selected characters by another character. In you example the
> > first character typed is "C-r" so the result should be something
> > like
> >
> > ^R Bar
> > ^R Bar
> > ^R Bar
> > ^R Bar
> > ^R Bar
> > ^R Bar
>
> If you have tried the scenario I provided, you would have noticed
> that the result is not as what you thought either.

I *have* tried this scenario and the result is exactly what I wrote -
at least on my Vim and my Emacs 23.2.1. Anyhow the behaviour you
request is a non-trivial issue because it interferes with the fact that
"r" expects a character and not a command. After pressing "r" and when
waiting for that character evil is *not* in insert-state so *no* insert
state binding is active. It is certainly possible to get the behavior
you desire but it needs work. Furthermore the behavior in many
situations has to be worked out:

What should happen if more than one column is selected? Replace each
single character by the yanked text (i.e. multiple copies of the yanked
text are inserted per line, one per character) or should the whole line
be replaced?

What should happen if the yanked text is line-wise or even a block
itself?


> What you said is what is working in Vim, not what is working
> currently in Evil, however, I think what is working in Evil is even
> better and more useful. I hope you are not going to follow Vim this
> time, and I believe Evil has done better than Vim in this matter and
> I don't think we have to always blindly follow Vim even when we know
> it is not good in the specific situation.
>
> If you guy's decide not to follow Vim here, than making "C-r" work in
> this situation will be even better.

I welcome any ideas to get evil better than vim, but I currently have
no idea for a robust behavior of the feature you want. But feel free
to provide one ...


Frank



More information about the implementations-list mailing list