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

Filter by major mode #28

Closed
shobute opened this issue Mar 27, 2018 · 3 comments
Closed

Filter by major mode #28

shobute opened this issue Mar 27, 2018 · 3 comments

Comments

@shobute
Copy link

shobute commented Mar 27, 2018

Great package, thank you!

I would like to filter the buffer list by, for example, the major mode. Helm lets you do this trivially by prefixing the pattern with a star (see: https://github.com/emacs-helm/helm/wiki/Buffers#buffers-by-major-mode). Is this possible with ivy-rich?

@Yevgnen
Copy link
Owner

Yevgnen commented Apr 2, 2018

Hi, thanks for the kind words.

ivy-rich just provide a display transform to the origin candidates. In fact, if you input emacs-lisp-mode or something like that, you would get nothing since the origin candidates are buffer names. I think it would be a ivy-switch-buffer feature to have search by major-mode etc.

I currently don't know if it's possible to do this in a 'display transformer', but I will dig into it once I have time.

@shobute
Copy link
Author

shobute commented Apr 7, 2018

Thank you! I guess one solution would be to have buffers automatically renamed to include their major mode, and then filter out the major mode part of the buffer name when displaying, but I feel like that could cause other issues and falls outside of the ivy-rich remit, so closing this issue. :)

@cjauvin
Copy link

cjauvin commented Nov 22, 2021

I have proposed a simple modification to ivy which allows to filter based on additional columns supplied by ivy-rich (or any user-supplied transformer function), on a per-command basis (i.e. in my personal case I use it only to modify the behavior of ivy-switch-buffer, as the extra cost of computing the transformations on the fly is low enough to be acceptable, which might not be the case with other functions).

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

3 participants