gpt4 book ai didi

linux - 如何使用缓冲区从文件 1 复制(抽取)并粘贴(放入)文件 2?

转载 作者:太空狗 更新时间:2023-10-29 12:11:41 26 4
gpt4 key购买 nike

我想知道在 vi 编辑器中使用缓冲区从文件 1 复制数据并将数据粘贴到文件 2 的过程。

你能告诉我一步一步的过程吗?

怎么做?

最佳答案

来自 vi 手册:

6.5.6.3 Using Named Buffers

To repeatedly insert a group of lines in various places within a document, you can yank (or delete) the linesinto a named buffer. You specify named buffers by preceding a commandwith double quotes (") and a name for the buffer. For example, to yankfour lines into the named buffer a, type "a4yy. You can use severaldifferent buffers. For example, you might also delete text from onelocation and add it to several others. To delete 12 lines into thenamed buffer b, type "b12dd.

To insert the text, precede the p or P command with n, where n is thenamed buffer. For example, to insert the lines saved in buffer b, type"bP.

You can overwrite named buffers with new lines. The buffers are saveduntil you exit vi.

When you use named buffers, you can safely delete and yank other textwithout affecting the lines you have already saved in the namedbuffers -- unless, of course, you purposely overwrite the namedbuffer.

关于linux - 如何使用缓冲区从文件 1 复制(抽取)并粘贴(放入)文件 2?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41812292/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com