Delete n lines in the up direction in vim
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.
In VIM, 3dk would delete 4 lines in the upward direction. Further documentation can be found at http://www.vim.org/docs.php
V3kd would do it.
Thats "V" to enter visual line select mode, "3k" to move up 3 lines, and then "d" to delete the 4 lines you have selected.
You can do it with a backwards range.
:-4,.d
Deletes from minus 4 lines to current. But this is an ex mode command.
- Position the cursor where you want to begin cutting.
- Press v (or upper case V if you want to cut whole lines).
- Move the cursor to the end of what you want to cut.
- Press d.
- Move to where you would like to paste.
- Press P to paste before the cursor, or p to paste after.
http://vim.wikia.com/wiki/Copy,_cut_and_paste
- stand at the end of the last line
- hold Backspace and wait until the last character of the first line is deleted
精彩评论