emacsevil-modeido

Getting ido to work with evil in emacs


I'm trying to get ido to work with evil ex commands (such as :vsp ... or :b ...), but it doesn't seem to be working automatically. Currently I have:

(require 'ido)
(setq ido-everywhere t)
(ido-mode t)
(use-package ido-ubiquitous
  :ensure ido-ubiquitous
  :demand ido-ubiquitous
  :init
  (progn
    (ido-ubiquitous-mode 1)))

And then later I require evil:

(use-package evil
  :ensure evil
  :config
  (progn
    (evil-mode 1)
    ;; ....
  ))

As a work around I can use stuff like (define-key evil-ex-map "e " 'ido-find-file) and some custom ones for the splits but this isn't ideal. Why doesn't the above work automatically?

I'm using the graphical version of Emacs 25.0.50.1


Solution

  • from the ido-ubiquitous source:

    ido-ubiquitous is here to enable ido-style completion for (almost) every function that uses the standard completion function 'completing-read'

    Evil uses completion-at-point rather than completing-read for ex commands. While completion-at-point merely tries to complete what's before the cursor, completing-read brings up its own prompt with its own behavior. Since evil adds its own keybindings in the ex prompt, using completing-read for ex commands isn't feasible.