3

short: after a counsel-yank-pop, yank does not yank the same entry. How can I achieve that behavior?

long: Having a kill-ring like:

foo
bar
baz

When doing a C-y (yank) and M-y (yank-pop) 'bar' will be inserted. And for every repeated C-y, 'bar' will be inserted again.
This is the behavior (repeated insertion of 'bar') I'd like to have with counsel-yank-pop instead of yank-pop.
But counsel-yank-pop does not seem to modify the kill-ring pointer for yank.
How can I achieve the wanted behavior?

Note: I'd like to keep using ivy and counsel, instead of switching to helm or something else.

jue
  • 4,476
  • 8
  • 20
  • This and other behaviours and intricacies of `yank-pop` are not currently supported by `counsel-yank-pop` (though someone may well be able to hack around the status quo). In the meantime I have submitted [PR #1356](https://github.com/abo-abo/swiper/pull/1356) to address this as well as many other potential discrepancies between `counsel-yank-pop` and `yank-pop`. – Basil Dec 08 '17 at 04:02

1 Answers1

3

counsel-yank-pop works as desired as of 2017-12-08.

The command now also accepts the same prefix argument as yank-pop which causes the corresponding kill to be preselected during completion.

Finally, counsel-yank-pop improves upon yank-pop in that it does not require the last-command to be a yank. In such cases it just inserts the selected kill at point without replacing any previous yanks.

Basil
  • 12,019
  • 43
  • 69