开发者

Vim: how to select a rect area and do copy/paste

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开发者_JAVA百科 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?


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.


In visual block mode (ctrl+v), highlight an area of your choice with the motion keys and then press "y" to copy the area, "p" to paste it (starting at the location of the cursor), or you can also press "x" to delete an highlighted area.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜