(Emacs+Org-Mode) Migrate From Ido To Ivy In One Quick Step

After avoiding migrating from Ido to Ivy for years I put in the time today. Long story short it was simple, fast, and easy. Here is the micro version of what it took:

I avoided migrating for years despite your continued enthusiasm Jon. The block for me was giving up Smex, and, Flx fuzzy matching. Turns out that Ivy easily utilizes both. Here is how to set it up:

(use-package counsel
  :ensure t
  :config
  (use-package smex
    :ensure t)
  (use-package flx
    :ensure t)
  (ivy-mode 1)
  (setq ivy-use-virtual-buffers t)
  ;; intentional space before end of string
  (setq ivy-count-format "(%d/%d) ")
  (setq ivy-initial-inputs-alist nil)
  (setq ivy-re-builders-alist
        '((t . ivy--regex-fuzzy))))

It is really that easy. You get exactly the fuzzy matching that you expect. As to the power of Ivy+Counsel+Swiper well I still don’t get it but now I have it. I’m just using the plain old stuff for now. So what do you do with it anyway?

The documentation explains what Ivy functions to use to replace the built in equivalents. Here were the most obvious places to start.

(global-set-key (kbd "M-j") #'counsel-M-x)
(global-set-key (kbd "C-o") #'counsel-find-file)

3 thoughts on “(Emacs+Org-Mode) Migrate From Ido To Ivy In One Quick Step”

  1. Would like to hear your experiences and how you adapt, especially with occur, grep, and git tasks surrounding (formerly) ido tasks. The last time I tried, it choked on directories with large numbers of files. I’m a little hesitant with whatever irreal recommends because he’s overly enthusiastic without proper experience.

    1. The largest collection of files that I operate on are 2151 Org-Mode text files that are are about 1k each. My use is limited to just opening them and Ag’ing through them. For that Ivy has worked without issue or slowdown. Sounds pretty limited compared to how you are using it. Would love to know more.

Leave a Reply

Your email address will not be published. Required fields are marked *