vim

#copy & paste

using text

:start line, end line copy dest ine

example :9,15 copy 16

it will copy line 9 to 15 to 16.

 

using v+y, p

1) v key, enter select mode, move current to select what your want , and then press "y" to copy the selected to memory

2) move the currsor to your desired position, press "p"

 

#paste

middle key of mouse or ctrl+shift+v

 

 

Cut and paste:

  1. Position the cursor where you want to begin cutting.
  2. Press v to select characters, or uppercase V to select whole lines, or Ctrl-v to select rectangular blocks (use Ctrl-q if Ctrl-v is mapped to paste).
  3. Move the cursor to the end of what you want to cut.
  4. Press d to cut (or y to copy).
  5. Move to where you would like to paste.
  6. Press P to paste before the cursor, or p to paste after.

Copy and paste is performed with the same steps except for step 4 where you would press y instead of d:

  • d stands for delete in Vim, which in other editors is usually called cut
  • y stands for yank in Vim, which in other editors is usually called copy

posted on 2020-03-19 11:18  荷树栋  阅读(99)  评论(0编辑  收藏  举报

导航