While editing, you will sometimes want to save just part of your file as a separate, new file. For example, you might have entered formatting codes and text that you want to use as a header for several files.
You can combine
w, to save part of a file. For example, if you are in the file
practice and want to save part of practice as the file
newfile, you could enter:
Saves from line 230 to end-of-file in newfile.
Saves from the current line to line 600 in newfile.
[After newfile has been created,
w! instead of
- from O'Reilly & Associates' Learning the vi Editor, Chapter 5