Vim: how to select a rectangle area and make a copy / paste

eg.

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 as 111.222.111.222, is also a repository in the direct text.

I know that Ctrl + v can make direct choices, but how to make a copy and paste?

+5
source share
3 answers

Ctrl-V, as you said, select, then "y" to "yank" (copy). Then you can insert it with "p". You can select the area you want to paste again using Ctrl-V and pressing "p" instead of just pressing "p". Vim will respect the rectangular area that you copied when pasting, so you don't have to reformat it.

+7

(ctrl + v) , "y", "p", ( ), "x", .

+1

Select with CTRL-Vand then the motion keys. If you installed showmode, you will see -- VISUAL BLOCK --below.

Copy

Select your destination with CTRL-V.

Paste

0
source

All Articles