开发者

Combining registers in vim

Is it possible to combine registers in vim? For example, if I have registers "a, "b, "c, can I easily create register "d which is a concatenation of all three? That is, without pasting them all and then selecting 开发者_运维百科the whole thing.


With the command :let @a = "something" you can assign to a register.

With the command :let @A = "another thing" or :let @a .= "another thing" you can append to a register.

Lets say your registers are filled as follows (inspected using the reg command)

:reg a b c
--- Registers ---
"a Apple^J
"b Pear^J
"c Banana^J

Then you can call

:let @D = @a
:let @D = @b
:ley @D = @c

or

:let @d = @a . @b . @c

And your register d looks like

:reg d
--- Registers ---
"d Apple^JPear^JBanana


:let @d = @a . @b . @c
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜