VIM: how to append yanked text to unnamed register

前端 未结 2 749
夕颜
夕颜 2020-12-11 00:42

I know \"Ayy can append current line to register a.

How do I append current line to unnamed register?

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-11 01:16

    1. Pick a free register among a-z (I prefer the register a)
    2. "ay{motion}
    3. "Ay{motion} ... (to append)
    4. Now you have all the yanked text in register a.
    5. And you have the same content in unnamed register as well!

    (I happened to find that the unnamed register is synchronized to the named register in such operation.)

    The benefit is ... You saves 2 keystrokes to put. ^_^

    See h: quote_quote

    NB: For operations d, c, s, x, you won't get the same appended text in the unnamed register as in the named register if you are using v7.4. (It's a bug, fixed in v8.0)

提交回复
热议问题