开发者

how to copy from other file in vi editor

开发者 https://www.devze.com 2023-01-22 06:02 出处:网络
how to copy from other file with ctrl-c and in vi editor with p yank (paste), i have开发者_运维知识库 no idea!!

how to copy from other file with ctrl-c and in vi editor with p yank (paste), i have开发者_运维知识库 no idea!! thinks


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.


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

If you want to paste text from outside of vi, you need to setup your terminal and vi specially to allow that.


You can't. The yank buffer is private to vim, not shared with the system clipboard.

0

精彩评论

暂无评论...
验证码 换一张
取 消