summaryrefslogtreecommitdiff
path: root/evil-collection.el
diff options
context:
space:
mode:
authorPierre Neidhardt <ambrevar@gmail.com>2017-12-08 18:02:29 +0100
committerPierre Neidhardt <ambrevar@gmail.com>2017-12-08 18:02:29 +0100
commit7a3f88668b9300f5188d9781777d468cbb62205a (patch)
treeaba4a7069824f643bd0d565427834856340ade0e /evil-collection.el
parent459395ebd311f201f456cfa84f460edfce0492e9 (diff)
Use an alist for evil-collection-mode-listinit
Diffstat (limited to 'evil-collection.el')
-rw-r--r--evil-collection.el135
1 files changed, 65 insertions, 70 deletions
diff --git a/evil-collection.el b/evil-collection.el
index 9b318df..1e4972a 100644
--- a/evil-collection.el
+++ b/evil-collection.el
@@ -36,76 +36,72 @@
"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
- anaconda-mode
- arc-mode
- bookmark
- calendar
- cider
- comint
- company
- compile
- custom
- cus-theme
- debbugs
- debug
- diff-mode
- dired
- doc-view
- edebug
- elfeed
- elisp-mode
- elisp-refs
- emms
- eshell
- eval-sexp-fu
- flycheck
- geiser
- ggtags
- help
- helm
- ibuffer
- image
- image+
- info
- ivy
- macrostep
- man
- ,@(when evil-collection-setup-minibuffer '(minibuffer))
+ `((ag t)
+ (alchemist t)
+ (anaconda-mode t)
+ (arc-mode t)
+ (bookmark t)
+ (calendar t)
+ (cider t)
+ (comint t)
+ (company t)
+ (compile t)
+ (custom t)
+ (cus-theme t)
+ (debbugs t)
+ (debug t)
+ (diff-mode t)
+ (dired t)
+ (doc-view t)
+ (edebug t)
+ (elfeed t)
+ (elisp-mode t)
+ (elisp-refs t)
+ (emms t)
+ (eshell t)
+ (eval-sexp-fu t)
+ (flycheck t)
+ (geiser t)
+ (ggtags t)
+ (help t)
+ (helm t)
+ (ibuffer t)
+ (image t)
+ (image+ t)
+ (info t)
+ (ivy t)
+ (macrostep t)
+ (man t)
+ (minibuffer nil)
;; occur is in replace.el which was built-in before Emacs 26.
(occur ,(if (<= emacs-major-version 25) "replace" 'replace))
- outline
- p4
+ (outline t)
+ (p4 t)
(package-menu package)
- pass
+ (pass t)
(pdf pdf-view)
- proced
- prodigy
- profiler
- rtags
- slime
- (term term ansi-term multi-term)
- tide
- transmission
- vlf
- woman
- xref
+ (proced t)
+ (prodigy t)
+ (profiler t)
+ (rtags t)
+ (slime t)
+ (term t ansi-term multi-term)
+ (tide t)
+ (transmission t)
+ (vlf t)
+ (woman t)
+ (xref t)
(ztree ztree-diff))
- "The list of modes which will be evilified by `evil-collection-init'.
-Elements are either target mode symbols or lists which `car' is the
-mode symbol and `cdr' the packages to register.
+ "The alist of modes which will be evilified by `evil-collection-init'.
+ The values are list of target modes. If t, then the target
+name is the same as the key.
+
+By default, `minibuffer' is not activated by default because many
+users find this confusing. It can be activated with
-By default, `minibuffer' is not included because many users find
-this confusing. It will be included if
-`evil-collection-setup-minibuffer' is set to t."
- :type '(repeat (choice symbol sexp))
+ (setcar (alist-get 'minibuffer evil-collection-mode-list) t)"
+ :type '(alist)
:group 'evil-collection)
;;;###autoload
@@ -120,15 +116,14 @@ instance:
(evil-collection-calendar-setup))"
(interactive)
(dolist (mode evil-collection-mode-list)
- (let ((m mode)
- (reqs (list mode)))
- (when (listp mode)
- (setq m (car mode)
- reqs (cdr mode)))
+ (let ((name (car mode))
+ (reqs (cdr mode)))
(dolist (req reqs)
+ (when (eq req t)
+ (setq req name))
(with-eval-after-load req
- (require (intern (concat "evil-collection-" (symbol-name m))))
- (funcall (intern (concat "evil-collection-" (symbol-name m) "-setup"))))))))
+ (require (intern (concat "evil-collection-" (symbol-name name))))
+ (funcall (intern (concat "evil-collection-" (symbol-name name) "-setup"))))))))
(provide 'evil-collection)
;;; evil-collection.el ends here