Write Lines To Another File Using Vim/Vi

This page answers questions like these:


Related Links:
Find Surrounding Code Block in Vim
Fold/Collapse/Hide Code Blocks in Vim
Expand/Show/Open Collapsed/Hidden/Folded Text in Vim
Replace with Confirmation in Vim
E432: Tags file not sorted: tags | E257: cstag: tag not found | E426: tag not found:



Copy Specific Line Numbers from One File to Another File:

vim FILE1
:4,17w!FILE2

Copy Some Lines of One File to Another File:

vim FILE1
Move to any position on the first line you want to copy (using commands like j, /, %, etc.)
ma
Move to any position on the last line you want to copy (using commands like j, /, %, etc.)
:'a,.w!FILE2


Related Links:
Find Surrounding Code Block in Vim
Fold/Collapse/Hide Code Blocks in Vim
Expand/Show/Open Collapsed/Hidden/Folded Text in Vim
Replace with Confirmation in Vim
E432: Tags file not sorted: tags | E257: cstag: tag not found | E426: tag not found:

Home  >  Vim  >  Write Lines To Another File Using Vim/Vi


Tags: replace with confirmation, confirmation, confirm, replace with confirm, global replace, replace, yes/no, vim

Copyright © HelpDoco.com
vim-write-lines-to-file.txt
Vim/vim-write-lines-to-another-file.htm
2