How to copy from another file in vi editor

how to copy from another file using ctrl-c and in the vi editor using p yank (paste), I have no idea !! believes that

+4
source share
3 answers

You can also do :r filename

This will pull the file. It can also be used to output the command:

 :r! grep some_text file :r! which perl 

Another way is to use buffers.

 :e other_file.txt 

Once you hold, you can :bn switch to another buffer and paste

If you're just concerned about pasting, ctrl-v or shift + insert also works to paste the contents of the clipboard.

+4
source

Once you have saved (copied) the text in vi, you can enter <ESC>:e filename to open another file for editing. Your yank buffer will still be the same, allowing you to paste into another file. You must copy text from one file in vi to another file in vi.

If you want to embed text from outside vi, you need to configure your terminal and vi specifically to allow this.

+3
source

You can not. The egg buffer is private to vim, not shared in the system clipboard.

+1
source

All Articles