First, a reminder: the text in a cut/paste buffer is discarded
as soon as you perform ANY other changes to the file/buffer...
So DON'T make any "slight adjustments", like adding a blank line,
before re-pastnig the text.
You can chose to cut/paste, or copy/paste as shown above.
CUT/PASTE:
- position cursor in first line you want to move.
- 8dd to delete eight lines, into buffer, change number as desired
- position curson on line directly above destination point
- p to paste text below current line
- you can also use other methods to 'cut' text, such as
d/foobar which would delete all lines, to the one with "foobar"
or COPY PASTE:
- position cursor in first line you want to move.
- 8y to 'Yank' eight lines, into buffer, change number as desired
- position curson on line directly above destination point
- p to paste text below current line
- y/foobar also works to YANK all text to searched string
this second method leaves the original text in place, which can
be safer - until you are more familiar with 'vi'
|