Yesterday, I wrote about Ben Maughan’s tip for maintaining the clipboard over an Emacs kill. If you read Maughan’s post you’ll see that there’s a link to a post on cycling through your Emacs kill ring. I remember seeing this before but it didn’t register. After reading his post on the clipboard, I reread the post on the kill ring and realized that it resolved a long standing irritant for me.
We all know about yank-pop
to yank older items on the kill ring but I always felt as if I were flying blind because you can’t see what you’re going to get until you run the command. There was also the problem that if you wanted an old entry you had to first do a normal yank before you could step back through the older entries. Abo-abo’s counsel-yank-pop
solves both these problems.
If you bind counsel-yank-pop
to Meta+y, you can bring up a menu containing the kill-ring entries and just choose whichever one you want in the usual Ivy way. Filtering and scrolling work just as they always do with Ivy. Maughan’s post describes a small tweak that allows you to repeatedly type Meta+y, to move back in the list. I’m perfectly happy to scroll with Ctrl+n and Ctrl+p so I didn’t bother with that.
This is the second of two packages that I’ve written about recently that transform the kill ring from being annoying to use to simple and enjoyable. The first is undo-tree and the second is counsel-yank-pop
(well, really ivy
and counsel
). If you don’t have them installed, you really should consider it. They will, I promise you, make your life simpler.