Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to copy from other file in vi editor

Tags:

linux

vi

how to copy from other file with ctrl-c and in vi editor with p yank (paste), i have no idea!! thinks

like image 338
schweinsteiger Avatar asked Feb 26 '23 23:02

schweinsteiger


1 Answers

You can also do: :r filename

This will pull in the file. It can also be used for output from a command:

:r! grep some_text file
:r! which perl

The other way is to use buffers.

:e other_file.txt

Once you yank, you can :bn to switch to the other buffer and paste

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

like image 182
Bruce Armstrong Avatar answered Mar 06 '23 23:03

Bruce Armstrong