开发者

how to copy from other file in vi editor

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜