You can use the UNIX redirect and append operator ( >> ) with w to append all or part of the contents of the buffer to an existing file. For example, if you entered:
>>
w
:1,10w newfile
:1,10w
newfile
and then:
$
:340,$w >> newfile
:340,$w >>
newfile would contain lines 1-10 and line 340 to the end of the buffer.
- TOR from O'Reilly & Associates' Learning the vi Editor , Chapter 5