在 vi 编辑器中,我如何将单词保存在多个缓冲区中并在我想要的任何地方使用它们(无需一次又一次地复制)

In vi editor how i can save words in multiple buffers and use them whereever i want (without copying again and again)

使用 vi 编辑器打开一个文件 "numbers",内容如下,我想复制这些词并在其余文档中随机多次使用它们。

one two three four five
yw copies a word and p (pastes the buffer) 
yy copies a line and p (pastes the buffer) 

("ayw) copies a word into  buffer named 'a' (single character a). ("ap) pastes the contents on buffer named 'a'.
("ayy) copies a line into  buffer named 'a' (single character a). ("ap) pastes the contents on buffer named 'a'.

vi 已命名缓冲区。如果我们做 yw 它会在未命名的缓冲区中复制单词,所以每次我们复制另一个单词时它都会覆盖缓冲区的内容。所以我们最终得到了我们制作的最后一个缓冲区。

复制时我们可以给缓冲区命名如下

在命令模式下将光标指向单词 say "one" 的开头(按 esc 以确保您处于命令模式)键入 ("ayw). This means the word is copied in buffer named "a"。要粘贴复制的单词 "one" 任何地方,你都可以按 ("ap).

类似地,您在命令模式下将光标指向第二个单词 "two"(按 esc 以确保您处于命令模式)键入 ("byw). This means the word is copied in buffer named "b"。要粘贴复制的单词 "two" 任何地方,你都可以按 ("bp).

类似地,您在命令模式下将光标指向第三个单词 "three"(按 esc 以确保您处于命令模式)键入 ("cyw). This means the word is copied in buffer named "c"。要粘贴复制的单词 "three" 在任何地方,你都可以按 ("cp).

等等。

希望对您有所帮助