Emacs: How to yank the last yanked text regardless of subsequent kills?

后端 未结 8 1010
無奈伤痛
無奈伤痛 2021-01-31 16:23

I often find myself repeatedly yanking something after doing some kills and it becomes a process like:

  1. C-y
  2. C-y M-y
  3. C-y M-y M-y
  4. C-y M-y M
8条回答
  •  梦谈多话
    2021-01-31 17:13

    1. If you want to repeatedly yank the same text, use the secondary selection instead of the region or killed text.

      What's missing from vanilla Emacs is a key binding to yank the secondary selection. I use C-M-y for that (see library second-sel.el).

    2. To get direct access to any kills in the kill ring, use M-y with Browse Kill Ring or with Icicles. In both cases, M-y at top level gives you access to all entries in the kill ring.

      And if you use library second-sel.el then, in addition to the kill ring, you have access to a ring of your past secondary selections.

      And if you use library second-sel.el and Icicles then M-y yanks an entry from the the ring you last yanked from (kill ring or secondary-selection ring).

      And if you use library browse-kill-ring+.el then the kill-ring browser gives you access to an alternative ring also (which, by default, is the ring of secondary selections if you use library second-sel.el).

提交回复
热议问题