2017-11-07 11:04:12 +01:00
|
|
|
;;; evil-collection.el --- A set of keybindings for Evil mode -*- lexical-binding: t -*-
|
2017-11-05 17:05:46 +01:00
|
|
|
|
|
|
|
;; Copyright (C) 2017 James Nguyen
|
|
|
|
|
2017-11-07 11:04:12 +01:00
|
|
|
;; Author: James Nguyen <james@jojojames.com>
|
|
|
|
;; Pierre Neidhardt <ambrevar@gmail.com>
|
|
|
|
;; Maintainer: James Nguyen <james@jojojames.com>
|
|
|
|
;; Pierre Neidhardt <ambrevar@gmail.com>
|
2017-11-05 17:05:46 +01:00
|
|
|
;; URL: https://github.com/jojojames/evil-collection
|
|
|
|
;; Version: 0.0.1
|
2017-11-15 09:50:19 +01:00
|
|
|
;; Package-Requires: ((emacs "25.1") (evil "1.2.13"))
|
2017-11-07 11:04:12 +01:00
|
|
|
;; Keywords: evil, tools
|
2017-11-05 17:05:46 +01:00
|
|
|
|
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
;;; Commentary:
|
2017-11-06 15:12:40 +01:00
|
|
|
;; A set of keybindings for Evil mode.
|
|
|
|
;;
|
|
|
|
;; If you want to use Evil in the minibuffer, you'll have to enable it manually.
|
|
|
|
;; This is so because many users find it confusing.
|
|
|
|
;;
|
|
|
|
;; (require 'evil-minibuffer)
|
|
|
|
;; (evil-minibuffer-init)
|
2017-11-05 17:05:46 +01:00
|
|
|
|
|
|
|
;;; Code:
|
2017-11-06 15:12:40 +01:00
|
|
|
(defvar evil-collection-mode-list
|
2017-11-10 12:38:08 +01:00
|
|
|
`(ag
|
2017-11-12 02:08:06 +01:00
|
|
|
anaconda-mode
|
2017-11-08 03:34:48 +01:00
|
|
|
arc-mode
|
2017-11-06 15:12:40 +01:00
|
|
|
bookmark
|
|
|
|
calendar
|
|
|
|
cider
|
2017-11-12 20:16:09 +01:00
|
|
|
comint
|
2017-11-11 22:58:26 +01:00
|
|
|
company
|
2017-11-06 15:12:40 +01:00
|
|
|
compile
|
|
|
|
custom
|
2017-11-12 01:39:42 +01:00
|
|
|
cus-theme
|
2017-11-06 17:51:24 +01:00
|
|
|
debbugs
|
2017-11-07 11:33:23 +01:00
|
|
|
debug
|
2017-11-06 15:12:40 +01:00
|
|
|
diff-mode
|
|
|
|
dired
|
2017-11-07 07:17:14 +01:00
|
|
|
doc-view
|
2017-11-06 15:12:40 +01:00
|
|
|
edebug
|
2017-11-06 17:52:14 +01:00
|
|
|
elfeed
|
2017-11-14 19:06:39 +01:00
|
|
|
elisp-mode
|
2017-11-09 05:44:06 +01:00
|
|
|
elisp-refs
|
2017-11-06 17:52:22 +01:00
|
|
|
emms
|
2017-11-06 15:12:40 +01:00
|
|
|
eshell
|
|
|
|
flycheck
|
|
|
|
ggtags
|
|
|
|
help
|
2017-11-06 17:52:31 +01:00
|
|
|
helm
|
2017-11-06 15:12:40 +01:00
|
|
|
ibuffer
|
|
|
|
image
|
2017-11-06 17:52:38 +01:00
|
|
|
image+
|
2017-11-06 15:12:40 +01:00
|
|
|
info
|
|
|
|
ivy
|
|
|
|
macrostep
|
|
|
|
man
|
2017-11-10 12:38:08 +01:00
|
|
|
;; occur is in replace.el which was built-in before Emacs 26.
|
|
|
|
(occur ,(if (<= emacs-major-version 25) "replace" 'replace))
|
2017-11-06 15:12:40 +01:00
|
|
|
outline
|
|
|
|
p4
|
|
|
|
(package-menu package)
|
|
|
|
pass
|
2017-11-06 17:53:22 +01:00
|
|
|
(pdf pdf-view)
|
2017-11-06 15:12:40 +01:00
|
|
|
proced
|
|
|
|
prodigy
|
|
|
|
profiler
|
|
|
|
slime
|
|
|
|
(term term ansi-term multi-term)
|
2017-11-11 23:51:25 +01:00
|
|
|
tide
|
2017-11-06 17:53:33 +01:00
|
|
|
transmission
|
2017-11-06 15:12:40 +01:00
|
|
|
vlf
|
|
|
|
woman
|
2017-11-06 17:53:44 +01:00
|
|
|
xref
|
|
|
|
(ztree ztree-diff))
|
2017-11-06 15:12:40 +01:00
|
|
|
"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.
|
|
|
|
|
|
|
|
By default, `minibuffer' is not included because many users find
|
|
|
|
this confusing.")
|
2017-11-05 17:05:46 +01:00
|
|
|
|
2017-11-14 17:54:02 +01:00
|
|
|
;;;###autoload
|
2017-11-06 15:12:40 +01:00
|
|
|
(defun evil-collection-init ()
|
|
|
|
"Register the Evil bindings for all modes in `evil-collection-mode-list'.
|
2017-11-05 17:05:46 +01:00
|
|
|
|
2017-11-06 15:12:40 +01:00
|
|
|
Alternatively, you may register select bindings manually, for
|
|
|
|
instance:
|
|
|
|
|
|
|
|
(with-eval-after-load 'calendar
|
|
|
|
(require 'evil-calendar)
|
2017-11-07 02:39:23 +01:00
|
|
|
(evil-calendar-setup))"
|
2017-11-05 17:05:46 +01:00
|
|
|
(interactive)
|
2017-11-06 15:12:40 +01:00
|
|
|
(dolist (mode evil-collection-mode-list)
|
|
|
|
(let ((m mode)
|
|
|
|
(reqs (list mode)))
|
|
|
|
(when (listp mode)
|
|
|
|
(setq m (car mode)
|
|
|
|
reqs (cdr mode)))
|
|
|
|
(dolist (req reqs)
|
|
|
|
(with-eval-after-load req
|
|
|
|
(require (intern (concat "evil-" (symbol-name m))))
|
2017-11-07 02:39:23 +01:00
|
|
|
(funcall (intern (concat "evil-" (symbol-name m) "-setup"))))))))
|
2017-11-05 17:05:46 +01:00
|
|
|
|
|
|
|
(provide 'evil-collection)
|
|
|
|
;;; evil-collection.el ends here
|