如何在不粘贴剪贴板的情况下将一个寄存器的内容复制到另一个寄存器?我猛拉了一条短信,然后它就在默认的 "寄存器里被猛拉了。现在我想复制另一个文本而不删除/覆盖 "寄存器。所以我想移动 "寄存器的内容来说一些 a或 b寄存器,这样我就可以复制 "中的新文本。怎么做?
"
a
b
You can do something like this:
let @a = getreg('"')
That'll copy the " register to the a register.
To copy or swap values between registers you can use the :let command, for example to copy the contents of the b register to a:
:let @a=@b
Or copy the contents of the " register to a:
:let @a=@"
Check this Vim Tip for some good key mapping suggestions: