Fork me on GitHub
#emacs
<
2020-02-14
>
ag02:02:40

does anyone know what ivy uses for CIDER commands, i.e. when you press in , in cider repl buffer, I want things to be sorted, but I don’t know what key to use in ivy-re-builders-alist

bozhidar05:02:42

@ag I assume ivy by default just displays the collections without reordering them. Probably the shortcut commands are not sorted internally.

ag05:02:30

nah… I think when I was using Helm it was fine (?) I don’t really remember now. But this is bugging me. For example I start typing cle and it shows:

clear-help-banner
clear-banners
clear
clear-output
what the heck? clearly, clear option, should be the first thing in the list

ag05:02:58

yup, that’s totally on Ivy’s side. When I have this: (setq ivy-re-builders-alist '((t . ivy--regex-fuzzy))) - it works as expected. The problem with that - it affects every Ivy popup: counsel, swiper, counsel-M-x, etc. And I don’t like that.

ag05:02:06

Currently I have it like this:

(setq ivy-re-builders-alist '((counsel-projectile-find-file . ivy--regex-fuzzy)
                              (counsel-projectile-find-dir . ivy--regex-fuzzy)
                              (ivy-switch-buffer . ivy--regex-fuzzy)
                              (t . ivy--regex-plus)))
and this works for me. But I can’t figure out which one drives cider-repl shortcuts

ag05:02:59

Holy cow… I found it. This works:

(setq ivy-re-builders-alist '((cider-repl-handle-shortcut . ivy--regex-fuzzy)
                              (t . ivy--regex-plus)))

ag05:02:21

Magic of @bbatsov. Your mere presence straightens up my emacs-fu @bozhidar

bozhidar05:02:12

Happy to help with my magic presence! This might be some useful addition to the documentation. 🙂