Copy And Paste Content From One File To Another File In Vi
Answer : Since you already know how to cut/yank text, here are a few ideas for pasting it back into another file: Edit the first file, yanking the text you want. Then open your second file from within vi ( :e /path/to/other/file ) and paste it Open both files together in a split window and navigate between them using Ctrl + w , Up / Down either by: vi -o /path/to/file1 /path/to/file2 From within the first file, Ctrl + w , s If you are using Vim on Windows, you can get access to the clipboard (MS copy/paste) using: " * d d -- cut a line (or 3dd to cut three lines) " * y y -- copy a line (or 3yy to copy three lines) " * p -- paste line(s) on line after the cursor " * P -- paste line(s) on line before the cursor The lets you paste between separate Vim windows or between Vim and PC applications (Notepad, Microsoft Word, etc.). Use the variations of d like dd to cut. To write a range of lines to another file you can use: :<n>,<m> w filename Wher...