I use abbrev-mode, smex, and ido-mode. How do I turn off abbrev-mode in the minibuffer for when I smex a command?

有帮助吗?

解决方案

This piece of code disables abbrev when you enter the minibuffer, then enables it again when you leave it.

(defun conditionally-disable-abbrev ()
  ""
  (if (string-match "smex-" (format "%s" this-command))
      (abbrev-mode -1)))

(add-hook 'minibuffer-setup-hook 'conditionally-disable-abbrev)
(add-hook 'minibuffer-exit-hook (lambda () (abbrev-mode 1)))

Added the fix by juanleon.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top