Vi Tips

Cut/Copy Paste a selection which starts not at the beginning of a line

2. Press v to select block
4. Cut it with d
4. Copy it with y
6. Press P (if you want to paste before) or p (if you want to paste after).
6. If you want to paste it later press "dp (or "yp for copy) to insert it after.

Cut/copy paste complete lines


You can mark any line of the editing buffer with a letter. Later you can easily return to the marked position.

Mark current line with letter b

You can use any letter from a through z.

Return to the line marked by letter b

Delete lines from the current position to the line marked by a

Delete the text between two marked positions a to b,

:'a,'b d

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License