Vi/vim, how can I write out a number of lines to a new file

editorsfilesvivim

While in an active Vim buffer, how can I write out a specific range of lines to a new file without closing the current buffer first?

Best Answer

You can do

:100,200w filename

Of course 100,200 is the range of lines you want to write.

Related Question