Saturday, January 27, 2007

Moving Text in vi editor

Command ------- Explaination
1. ------ Move the cursor to the top of the paragraph you want to move.
2. ma --- Place a mark named "a" at this location. (Vim will give you no indication that this command has been executed. In other words, the screen will not change.)
3. ------ Move the cursor to the bottom of the paragraph to be moved.
4. d'a -- Delete to mark "a". This puts the deleted text in a cut buffer.
5. ------ Move the cursor to line where the text is to go. The paragraph will be placed after this one.
6. p ---- Paste the text in below the cursor.

No comments: