vimtricks.wiki Concise Vim tricks, one at a time.

How do you write a range of lines to a separate file?

Answer

:10,20w newfile.txt

Explanation

Use :10,20w newfile.txt to write lines 10-20 to a new file. Use :10,20w >> existing.txt to append to an existing file.

Next

How do I visually select a double-quoted string including the quotes themselves?