tags:

views:

67

answers:

2

e.g.

1.1.1.1  a.com
2.1.1.1  b.com
1.3.1.1  c.com
1.1.5.1  d.com
1.2.1.1  e.com

now I want to replace this ip from another text, not the same width, like 111.222.111.222, is also store in a rect text.

I know that Ctrl+v can do rect select, but how to do copy and paste?

+2  A: 

Ctrl-V, as you said, to select, then 'y' to "yank" (copy). You can then paste it with 'p'. You can select an area in which to paste by again using Ctrl-V and hitting 'p' instead of just hitting 'p'. Vim will respect the rectangular area that you copied when you do the pasting, so you won't need to reformat.

siride
A: 

Select with CTRL-V and then motion keys. If you have set showmode you will see -- VISUAL BLOCK -- at the bottom.

Copy.

Select the destination again with CTRL-V.

Paste.

dtmilano
OP knows `CTRL-V` is used for visual select, he is asking how to copy/paste.
N 1.1
But probably OP didn't know about using CTRL-V twice. It doesn't hurt just mentioning it.
dtmilano