Working around with vim.
Copying a block of text from one file to another (Vi Style)
There is more than one way to copy text between files. In this section we use the more triditionally Vi commands. In the next section Copying using visual mode, we perform the same operations using the Visual mode.
To copy a block of text between files execute the commands:
Command | Explaination | |
1. | Edit the file containing the text you want to copy. | |
2. | Go to the top line to be copied. | |
3. | ma | Mark this line as mark "a". |
4. | Go to the bottom line to be copied | |
5. | y'a | Yank (y) the text from the current cursor location to the mark "a" ('a) |
6. | :split second-file | Open another window containing the second file. (This the file in which the text is to be inserted.) |
7. | Go to the line where the insert is to occur. The text will be place after this line. | |
8. | p | Put the text after the cursor. |
No comments:
Post a Comment