I have a bunch of lines that I want to write out to a different file.
How can I do that?
|
|
|
You can do
Of course 100,200 is the range of lines you want to write. |
|||||||
|
|
The most general:
That will work in vi, nvi and vim. Another method, works in more modern vim:
You can add singled lines to the end of the file as you need to by putting your cursor on the line you want to write out then typing: The "write a group of lines" commands also work with ">> filename" instead of just "filename". The ">>" causes vi or vim to append to the file, rather than just writing it. |
|||
|
|
|
To add to Bernhard's answer, you can also select a region using visual mode and then enter |
|||
|
|