Delete n lines in the up direction in vim

前端 未结 5 2024
旧时难觅i
旧时难觅i 2021-02-01 12:41

Is there a command in vim which will delete n lines in the up direction.

I know I can use 4dd which will delete 4 lines downwards.

5条回答
  •  难免孤独
    2021-02-01 13:22

    1. Position the cursor where you want to begin cutting.
    2. Press v (or upper case V if you want to cut whole lines).
    3. Move the cursor to the end of what you want to cut.
    4. Press d.
    5. Move to where you would like to paste.
    6. Press P to paste before the cursor, or p to paste after.

    http://vim.wikia.com/wiki/Copy,_cut_and_paste

提交回复
热议问题