Add a defcustom to enable minibuffer bindings
This commit is contained in:
parent
515a66b335
commit
21e9a7d7bc
|
@ -45,7 +45,7 @@ it does not have a mode."
|
||||||
;; then it may conflict with other packages' if they do the same.
|
;; then it may conflict with other packages' if they do the same.
|
||||||
(evil-insert 1))
|
(evil-insert 1))
|
||||||
|
|
||||||
(defun evil-collection-minibuffer-init ()
|
(defun evil-collection-minibuffer-setup ()
|
||||||
"Initialize minibuffer for `evil'."
|
"Initialize minibuffer for `evil'."
|
||||||
;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-from-Minibuffer.html
|
;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-from-Minibuffer.html
|
||||||
;; WARNING: With lexical binding, lambdas from `mapc' and `dolist' become
|
;; WARNING: With lexical binding, lambdas from `mapc' and `dolist' become
|
||||||
|
|
|
@ -27,17 +27,20 @@
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;; A set of keybindings for Evil mode.
|
;; 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.
|
;; This is so because many users find it confusing.
|
||||||
;;
|
|
||||||
;; (require 'evil-minibuffer)
|
|
||||||
;; (evil-minibuffer-init)
|
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(defgroup evil-collection nil
|
(defgroup evil-collection nil
|
||||||
"A set of keybindings for Evil mode"
|
"A set of keybindings for Evil mode"
|
||||||
:group 'evil)
|
: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
|
(defcustom evil-collection-mode-list
|
||||||
`(ag
|
`(ag
|
||||||
alchemist
|
alchemist
|
||||||
|
@ -75,6 +78,7 @@
|
||||||
ivy
|
ivy
|
||||||
macrostep
|
macrostep
|
||||||
man
|
man
|
||||||
|
,@(when evil-collection-setup-minibuffer '(minibuffer))
|
||||||
;; occur is in replace.el which was built-in before Emacs 26.
|
;; occur is in replace.el which was built-in before Emacs 26.
|
||||||
(occur ,(if (<= emacs-major-version 25) "replace" 'replace))
|
(occur ,(if (<= emacs-major-version 25) "replace" 'replace))
|
||||||
outline
|
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.
|
mode symbol and `cdr' the packages to register.
|
||||||
|
|
||||||
By default, `minibuffer' is not included because many users find
|
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))
|
:type '(repeat (choice symbol sexp))
|
||||||
:group 'evil-collection)
|
:group 'evil-collection)
|
||||||
|
|
||||||
|
|
|
@ -48,11 +48,14 @@ or mode-by-mode, for instance:
|
||||||
The list of supported modes is simply the list of files.
|
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
|
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)
|
~use-package~ example:
|
||||||
: (evil-collection-minibuffer-init)
|
|
||||||
|
|
||||||
|
: (use-package evil-collection
|
||||||
|
: :custom (evil-collection-setup-minibuffer t)
|
||||||
|
: :init (evil-collection-init))
|
||||||
|
|
||||||
|
|
||||||
** Guidelines
|
** Guidelines
|
||||||
|
|
Loading…
Reference in New Issue