diff --git a/evil-collection-minibuffer.el b/evil-collection-minibuffer.el index a1e8827..05d368e 100644 --- a/evil-collection-minibuffer.el +++ b/evil-collection-minibuffer.el @@ -45,7 +45,7 @@ it does not have a mode." ;; then it may conflict with other packages' if they do the same. (evil-insert 1)) -(defun evil-collection-minibuffer-init () +(defun evil-collection-minibuffer-setup () "Initialize minibuffer for `evil'." ;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-from-Minibuffer.html ;; WARNING: With lexical binding, lambdas from `mapc' and `dolist' become diff --git a/evil-collection.el b/evil-collection.el index a053948..2632678 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -27,17 +27,20 @@ ;;; Commentary: ;; A set of keybindings for Evil mode. ;; -;; If you want to use Evil in the minibuffer, you'll have to enable it manually. +;; If you want to use Evil in the minibuffer, you'll have to enable it by +;; setting `evil-collection-setup-minibuffer' to t before loading this package. ;; This is so because many users find it confusing. -;; -;; (require 'evil-minibuffer) -;; (evil-minibuffer-init) ;;; Code: (defgroup evil-collection nil "A set of keybindings for Evil mode" :group 'evil) +(defcustom evil-collection-setup-minibuffer nil + "Whether to setup evil bindings in the minibuffer." + :type 'boolean + :group 'evil-collection) + (defcustom evil-collection-mode-list `(ag alchemist @@ -75,6 +78,7 @@ ivy macrostep man + ,@(when evil-collection-setup-minibuffer '(minibuffer)) ;; occur is in replace.el which was built-in before Emacs 26. (occur ,(if (<= emacs-major-version 25) "replace" 'replace)) outline @@ -99,7 +103,8 @@ Elements are either target mode symbols or lists which `car' is the mode symbol and `cdr' the packages to register. By default, `minibuffer' is not included because many users find -this confusing." +this confusing. It will be included if +`evil-collection-setup-minibuffer' is set to t." :type '(repeat (choice symbol sexp)) :group 'evil-collection) diff --git a/readme.org b/readme.org index b2feefd..ec51b8d 100644 --- a/readme.org +++ b/readme.org @@ -48,11 +48,14 @@ or mode-by-mode, for instance: The list of supported modes is simply the list of files. If you want to enable Evil in the minibuffer, you'll have to turn it on -explicitly. This is so because many users find it confusing. +explicitly by customizing ~evil-collection-setup-minibuffer~ to ~t~. This is so +because many users find it confusing. -: (require 'evil-collection-minibuffer) -: (evil-collection-minibuffer-init) +~use-package~ example: +: (use-package evil-collection +: :custom (evil-collection-setup-minibuffer t) +: :init (evil-collection-init)) ** Guidelines