2

Is there a way to easily achieve the above?

For e.g., given

red apple
red banana
red cucumber

The fruits are blue.

Is there a way for me to yank the word "blue", then visually-select the column of "red" words and paste so that we get:

blue apple
blue banana
blue cucumber.

The words are blue.

Right now, the first "red" gets replaced and the remaining get cleared.

4

2 回答 2

3

When the red column is selected, do the following:

c         " change
<C-r>0    " Ctrl+r followed by 0 inserts the last yanked text (from register 0)
<Esc>     " exit insert mode and apply change to the whole column
于 2013-04-17T05:42:55.473 回答
1

My UnconditionalPaste plugin will allow that. Select the block of red, then press gr. All words will be replaced by the previously yanked blue, plus the unnamed register continues to hold blue.

于 2013-04-17T06:08:13.157 回答