Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserting all entries from a counsel match list into a text buffer? #197

Closed
drorbemet opened this issue Aug 13, 2015 · 3 comments
Closed

Comments

@drorbemet
Copy link

Using counsel e.g counsel-el I would find it useful to insert all matches into current text buffer at point by hitting something like M-RET instead of RET for instance.
That way I could insert lists of search results making resources from emacs even more available in text files.
Does that feature already exist and I just didn't find it?
What do you think about it?

@abo-abo
Copy link
Owner

abo-abo commented Aug 13, 2015

This feature isn't hard to implement, but I can't think of a good binding for it. Here's the code to do it:

(define-key ivy-minibuffer-map (kbd "C-M-i")
  (lambda ()
    (interactive)
    (with-ivy-window
      (insert
       (mapconcat
        #'identity
        ivy--old-cands
        "\n")))))

I'm not yet sure about the binding or the usability yet. Maybe it should put the text on the kill ring instead. I'll think about it more tomorrow.

@drorbemet
Copy link
Author

Thank you for this tip. This one is very useful for me.

@abo-abo
Copy link
Owner

abo-abo commented Aug 14, 2015

You can now press M-w to store all current candidates into the kill ring. Then yank it where you want. If the region is active in the minibuffer, a regular kill ring save will be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants