dot/emacs: Turn on the fancy Ido toys.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 16 Jul 2017 23:27:29 +0000 (00:27 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 16 Jul 2017 23:31:39 +0000 (00:31 +0100)
If we have `ido-completing-read+' then we can safely turn on Magit's Ido
support (which apparently depends on that package to sort out some edge
cases).  The `ido-ubiquitous' package extends Ido goodness to other
commands, and depends on `ido-completing-read+' to do its dirty work
anyway, so if we can enable that then it's safe to throw Magit's switch.
Finally, `smex' brings Ido goodness to M-x.

For safety's sake, leave traditional `execute-extended-command' on C-c
M-x.

dot/emacs

index bb9808f..2ab6381 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
 (trap
   (windmove-default-keybindings))
 (setq windmove-wrap-around t)
-(trap (ido-mode))
+(trap (require 'ido) (ido-mode 1)
+      (require 'ido-ubiquitous) (ido-ubiquitous-mode 1)
+      (setq magit-completing-read-function 'magit-ido-completing-read)
+      (require 'smex) (smex-initialize) (global-set-key [?\M-x] 'smex))
 (progn
+  (global-set-key [?\C-c ?\M-x] 'execute-extended-command)
   (global-set-key [?\e ?\e] 'mdw-wrong)
   (global-set-key [?\e ?\C-\] ?\C-\]] 'keyboard-escape-quit)
   (global-set-key [?\C-c ?w left] 'windmove-left)