summaryrefslogtreecommitdiff
path: root/modes
diff options
context:
space:
mode:
authorJustin Burkett <justin@burkett.cc>2018-07-12 15:05:50 -0400
committerJames N <james@jojojames.com>2019-10-09 19:41:45 -0700
commit95dad4c734ae3d3811c05b259eea15ac4f3cb5c5 (patch)
treed2e8bad926a11d2665ce3c86ca986e0f1447a23c /modes
parent34d515e99e911f368b335bbccc026b71b42a9821 (diff)
Use subdirectories for setup files (+READMEs)
Move setup files into subdirectories. Move mode directories to modes subdir. This will make it easy to specify a recipe in melpa that maintains the directory structure. Add interactive functions to jump to .el and README files See #170
Diffstat (limited to 'modes')
-rw-r--r--modes/ag/evil-collection-ag.el63
-rw-r--r--modes/alchemist/evil-collection-alchemist.el114
-rw-r--r--modes/anaconda-mode/evil-collection-anaconda-mode.el64
-rw-r--r--modes/arc-mode/evil-collection-arc-mode.el77
-rw-r--r--modes/bookmark/evil-collection-bookmark.el79
-rw-r--r--modes/buff-menu/evil-collection-buff-menu.el122
-rw-r--r--modes/calc/evil-collection-calc.el174
-rw-r--r--modes/calendar/evil-collection-calendar.el105
-rw-r--r--modes/cider/evil-collection-cider.el227
-rw-r--r--modes/cmake-mode/evil-collection-cmake-mode.el44
-rw-r--r--modes/comint/evil-collection-comint.el58
-rw-r--r--modes/company/evil-collection-company.el83
-rw-r--r--modes/compile/evil-collection-compile.el61
-rw-r--r--modes/cus-theme/evil-collection-cus-theme.el65
-rw-r--r--modes/custom/evil-collection-custom.el68
-rw-r--r--modes/daemons/evil-collection-daemons.el68
-rw-r--r--modes/debbugs/evil-collection-debbugs.el81
-rw-r--r--modes/debug/evil-collection-debug.el72
-rw-r--r--modes/diff-mode/evil-collection-diff-mode.el147
-rw-r--r--modes/dired/evil-collection-dired.el192
-rw-r--r--modes/doc-view/evil-collection-doc-view.el84
-rw-r--r--modes/edebug/evil-collection-edebug.el125
-rw-r--r--modes/ediff/evil-collection-ediff.el205
-rw-r--r--modes/elfeed/evil-collection-elfeed.el121
-rw-r--r--modes/elisp-mode/evil-collection-elisp-mode.el79
-rw-r--r--modes/elisp-refs/evil-collection-elisp-refs.el52
-rw-r--r--modes/emms/evil-collection-emms.el248
-rw-r--r--modes/epa/evil-collection-epa.el71
-rw-r--r--modes/ert/evil-collection-ert.el71
-rw-r--r--modes/eshell/evil-collection-eshell.el100
-rw-r--r--modes/eval-sexp-fu/evil-collection-eval-sexp-fu.el61
-rw-r--r--modes/eww/evil-collection-eww.el153
-rw-r--r--modes/flycheck/evil-collection-flycheck.el56
-rw-r--r--modes/free-keys/evil-collection-free-keys.el53
-rw-r--r--modes/geiser/evil-collection-geiser.el104
-rw-r--r--modes/ggtags/evil-collection-ggtags.el100
-rw-r--r--modes/git-timemachine/evil-collection-git-timemachine.el49
-rw-r--r--modes/go-mode/evil-collection-go-mode.el47
-rw-r--r--modes/grep/evil-collection-grep.el45
-rw-r--r--modes/guix/evil-collection-guix.el227
-rw-r--r--modes/helm/evil-collection-helm.el212
-rw-r--r--modes/help/evil-collection-help.el75
-rw-r--r--modes/ibuffer/evil-collection-ibuffer.el197
-rw-r--r--modes/image+/evil-collection-image+.el54
-rw-r--r--modes/image/evil-collection-image.el92
-rw-r--r--modes/imenu-list/evil-collection-imenu-list.el47
-rw-r--r--modes/indium/evil-collection-indium.el110
-rw-r--r--modes/info/evil-collection-info.el114
-rw-r--r--modes/ivy/evil-collection-ivy.el111
-rw-r--r--modes/js2-mode/evil-collection-js2-mode.el46
-rw-r--r--modes/kotlin-mode/evil-collection-kotlin-mode.el42
-rw-r--r--modes/log-view/evil-collection-log-view.el63
-rw-r--r--modes/lsp-ui-imenu/evil-collection-lsp-ui-imenu.el47
-rw-r--r--modes/lua-mode/evil-collection-lua-mode.el50
-rw-r--r--modes/macrostep/evil-collection-macrostep.el52
-rw-r--r--modes/magit/evil-collection-magit.el51
-rw-r--r--modes/man/evil-collection-man.el68
-rw-r--r--modes/minibuffer/evil-collection-minibuffer.el76
-rw-r--r--modes/mu4e-conversation/evil-collection-mu4e-conversation.el75
-rw-r--r--modes/mu4e/evil-collection-mu4e.el338
-rw-r--r--modes/neotree/evil-collection-neotree.el101
-rw-r--r--modes/notmuch/evil-collection-notmuch.el250
-rw-r--r--modes/nov/evil-collection-nov.el67
-rw-r--r--modes/occur/evil-collection-occur.el74
-rw-r--r--modes/outline/evil-collection-outline.el98
-rw-r--r--modes/p4/evil-collection-p4.el123
-rw-r--r--modes/package-menu/evil-collection-package-menu.el57
-rw-r--r--modes/pass/evil-collection-pass.el61
-rw-r--r--modes/pdf/evil-collection-pdf.el283
-rw-r--r--modes/popup/evil-collection-popup.el44
-rw-r--r--modes/proced/evil-collection-proced.el93
-rw-r--r--modes/prodigy/evil-collection-prodigy.el80
-rw-r--r--modes/profiler/evil-collection-profiler.el71
-rw-r--r--modes/python/evil-collection-python.el48
-rw-r--r--modes/quickrun/evil-collection-quickrun.el42
-rw-r--r--modes/racer/evil-collection-racer.el48
-rw-r--r--modes/realgud/evil-collection-realgud.el103
-rw-r--r--modes/reftex/evil-collection-reftex.el142
-rw-r--r--modes/rjsx-mode/evil-collection-rjsx-mode.el47
-rw-r--r--modes/robe/evil-collection-robe.el45
-rw-r--r--modes/rtags/evil-collection-rtags.el141
-rw-r--r--modes/ruby-mode/evil-collection-ruby-mode.el45
-rw-r--r--modes/simple/evil-collection-simple.el48
-rw-r--r--modes/slime/evil-collection-slime.el205
-rw-r--r--modes/term/evil-collection-term.el167
-rw-r--r--modes/tide/evil-collection-tide.el64
-rw-r--r--modes/transmission/evil-collection-transmission.el173
-rw-r--r--modes/typescript-mode/evil-collection-typescript-mode.el46
-rw-r--r--modes/vc-annotate/evil-collection-vc-annotate.el59
-rw-r--r--modes/vc-git/evil-collection-vc-git.el41
-rw-r--r--modes/vdiff/evil-collection-vdiff.el60
-rw-r--r--modes/view/evil-collection-view.el55
-rw-r--r--modes/vlf/evil-collection-vlf.el78
-rw-r--r--modes/wdired/evil-collection-wdired.el49
-rw-r--r--modes/wgrep/evil-collection-wgrep.el49
-rw-r--r--modes/which-key/evil-collection-which-key.el52
-rw-r--r--modes/woman/evil-collection-woman.el51
-rw-r--r--modes/xref/evil-collection-xref.el58
-rw-r--r--modes/ztree/evil-collection-ztree.el73
99 files changed, 9326 insertions, 0 deletions
diff --git a/modes/ag/evil-collection-ag.el b/modes/ag/evil-collection-ag.el
new file mode 100644
index 0000000..fd179ff
--- /dev/null
+++ b/modes/ag/evil-collection-ag.el
@@ -0,0 +1,63 @@
+;;; evil-collection-ag.el --- Evil Bindings for Ag -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, ag, tools
+
+;; 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:
+;; Evil bindings for `ag-mode' from the `wgrep-ag' package.
+
+;;; Code:
+(require 'ag nil t)
+(require 'evil-collection)
+
+(defconst evil-collection-ag-maps '(ag-mode-map))
+
+;;;###autoload
+(defun evil-collection-ag-setup ()
+ "Set up `evil' bindings for `ag'."
+ (evil-collection-define-key '(normal visual) 'ag-mode-map
+ "k" 'evil-previous-line
+ "h" 'evil-backward-char
+
+ ;; refresh
+ "gr" 'recompile
+
+ ;; navigation
+ "gj" 'compilation-next-error
+ "gk" 'compilation-previous-error
+ (kbd "C-j") 'compilation-next-error
+ (kbd "C-k") 'compilation-previous-error
+ "]]" 'compilation-next-error
+ "[[" 'compilation-previous-error
+
+ ;; search
+ "?" evil-collection-evil-search-backward
+ "/" evil-collection-evil-search-forward
+ "n" evil-collection-evil-search-next
+ "N" evil-collection-evil-search-previous)
+ ;; `ag' is best set in 'normal state because its buffer can be edited.
+ ;; https://github.com/mhayashi1120/Emacs-wgrep
+ (evil-set-initial-state 'ag-mode 'normal))
+
+(provide 'evil-collection-ag)
+;;; evil-collection-ag.el ends here
diff --git a/modes/alchemist/evil-collection-alchemist.el b/modes/alchemist/evil-collection-alchemist.el
new file mode 100644
index 0000000..c055006
--- /dev/null
+++ b/modes/alchemist/evil-collection-alchemist.el
@@ -0,0 +1,114 @@
+;;; evil-collection-alchemist.el --- Bindings for `alchemist'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, alchemist, tools
+
+;; 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:
+;;; Bindings for `alchemist'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'alchemist nil t)
+
+(defconst evil-collection-alchemist-maps '(alchemist-compile-mode-map
+ alchemist-eval-mode-map
+ alchemist-execute-mode-map
+ alchemist-message-mode-map
+ alchemist-help-minor-mode-map
+ alchemist-macroexpand-mode-map
+ alchemist-mix-mode-map
+ alchemist-test-report-mode-map
+ alchemist-mode-map))
+
+
+;;;###autoload
+(defun evil-collection-alchemist-setup ()
+ "Set up `evil' bindings for `alchemist'."
+ (evil-set-initial-state 'alchemist-compile-mode 'normal)
+ (evil-set-initial-state 'alchemist-eval-mode 'normal)
+ (evil-set-initial-state 'alchemist-execute-mode 'normal)
+ (evil-set-initial-state 'alchemist-message-mode 'normal)
+ (evil-set-initial-state 'alchemist-help-minor-mode 'normal)
+ (evil-set-initial-state 'alchemist-macroexpand-mode 'normal)
+ (evil-set-initial-state 'alchemist-refcard-mode 'normal)
+ (evil-set-initial-state 'alchemist-mix-mode 'normal)
+ (evil-set-initial-state 'alchemist-test-mode 'normal)
+ (evil-set-initial-state 'alchemist-test-report-mode 'normal)
+
+ (evil-collection-define-key 'normal 'alchemist-compile-mode-map
+ "q" 'quit-window)
+
+ (evil-collection-define-key 'normal 'alchemist-eval-mode-map
+ "q" 'quit-window)
+
+ (evil-collection-define-key 'normal 'alchemist-execute-mode-map
+ "q" 'quit-window)
+
+ (evil-collection-define-key 'normal 'alchemist-message-mode-map
+ "q" 'quit-window)
+
+ (evil-collection-define-key 'normal 'alchemist-help-minor-mode-map
+ "q" 'quit-window
+ "K" 'alchemist-help-search-at-point
+ "m" 'alchemist-help-module
+ "s" 'alchemist-help
+ "gh" 'alchemist-help-history
+ "gd" 'alchemist-goto-definition-at-point
+ "g?" 'alchemist-help-minor-mode-key-binding-summary)
+
+ (evil-collection-define-key 'normal 'alchemist-macroexpand-mode-map
+ "q" 'quit-window)
+
+ (evil-collection-define-key 'normal 'alchemist-refcard-mode-map
+ "gd" 'alchemist-refcard--describe-funtion-at-point
+ "g?" 'alchemist-refcard--describe-funtion-at-point
+ "q" 'quit-window)
+
+ (evil-collection-define-key 'normal 'alchemist-mix-mode-map
+ "q" 'quit-window
+ "i" 'alchemist-mix-send-input-to-mix-process
+ "gr" 'alchemist-mix-rerun-last-task)
+
+ (evil-collection-define-key 'normal 'alchemist-test-report-mode-map
+ "q" 'quit-window
+ "t" 'toggle-truncate-lines
+ "gr" 'alchemist-mix-rerun-last-test
+ "gj" 'alchemist-test-next-result
+ "gk" 'alchemist-test-previous-result
+ (kbd "C-j") 'alchemist-test-next-result
+ (kbd "C-k") 'alchemist-test-previous-result
+ "]]" 'alchemist-test-next-stacktrace-file
+ "[[" 'alchemist-test-previous-stacktrace-file
+ (kbd "C-c C-k") 'alchemist-report-interrupt-current-process)
+
+ (evil-collection-define-key 'normal 'alchemist-mode-map
+ "gz" 'alchemist-iex-run
+ "K" 'alchemist-help-search-at-point
+ "gd" 'alchemist-goto-definition-at-point
+ (kbd "C-t") 'alchemist-goto-jump-back
+ "g?" 'alchemist-help
+ (kbd "C-j") 'alchemist-goto-jump-to-next-def-symbol
+ (kbd "C-k") 'alchemist-goto-jump-to-previous-def-symbol))
+
+(provide 'evil-collection-alchemist)
+;;; evil-collection-alchemist.el ends here
diff --git a/modes/anaconda-mode/evil-collection-anaconda-mode.el b/modes/anaconda-mode/evil-collection-anaconda-mode.el
new file mode 100644
index 0000000..d7dceab
--- /dev/null
+++ b/modes/anaconda-mode/evil-collection-anaconda-mode.el
@@ -0,0 +1,64 @@
+;;; evil-collection-anaconda-mode.el --- Bindings for `anaconda-mode'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, python, tools
+
+;; 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:
+;;; Bindings for `anaconda-mode'.
+
+;;; Code:
+(require 'anaconda-mode nil t)
+(require 'evil-collection)
+
+(defconst evil-collection-anaconda-mode-maps '(anaconda-view-mode-map
+ anaconda-mode-map))
+
+;;;###autoload
+(defun evil-collection-anaconda-mode-setup ()
+ "Set up `evil' bindings for `anaconda-mode'."
+ ;; Bindings don't seem to be set the first time.
+ (add-hook 'anaconda-mode-hook #'evil-normalize-keymaps)
+
+ ;; latest anaconda has replaced view mode by an xref implementation,
+ ;; anaconda stable uses `anaconda-view-mode-map'
+ (when (boundp 'anaconda-view-mode-map)
+ (evil-collection-define-key 'normal 'anaconda-view-mode-map
+ "gj" 'next-error-no-select
+ "gk" 'previous-error-no-select
+ (kbd "C-j") 'next-error-no-select
+ (kbd "C-k") 'previous-error-no-select
+ "]]" 'next-error-no-select
+ "[[" 'previous-error-no-select
+ "q" 'quit-window))
+
+ (evil-collection-define-key 'normal 'anaconda-mode-map
+ ;; Would be nice to support these too.
+ ;; 'anaconda-mode-find-assignments
+ ;; 'anaconda-mode-find-references
+ "gd" 'anaconda-mode-find-definitions
+ (kbd "C-t") (if (fboundp 'anaconda-mode-go-back)
+ 'anaconda-mode-go-back
+ 'xref-pop-marker-stack)
+ "K" 'anaconda-mode-show-doc))
+
+(provide 'evil-collection-anaconda-mode)
+;;; evil-collection-anaconda-mode.el ends here
diff --git a/modes/arc-mode/evil-collection-arc-mode.el b/modes/arc-mode/evil-collection-arc-mode.el
new file mode 100644
index 0000000..820f305
--- /dev/null
+++ b/modes/arc-mode/evil-collection-arc-mode.el
@@ -0,0 +1,77 @@
+;;; evil-collection-arc-mode.el --- Evil bindings for arc-mode. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, arc-mode, archive, bindings, files
+
+;; 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:
+;;; Evil bindings for arc-mode.
+
+;;; Code:
+(require 'arc-mode)
+(require 'evil-collection)
+
+(defconst evil-collection-arc-mode-maps '(archive-mode-map))
+
+;;;###autoload
+(defun evil-collection-arc-mode-setup ()
+ "Set up `evil' bindings for `arc-mode'."
+ (evil-set-initial-state 'arc-mode 'normal)
+ (evil-set-initial-state 'archive-mode 'normal)
+ (evil-collection-define-key 'normal 'archive-mode-map
+ "j" 'archive-next-line
+ "k" 'archive-previous-line
+ (kbd "C-j") 'archive-next-line
+ (kbd "C-k") 'archive-previous-line
+ "gj" 'archive-next-line
+ "gk" 'archive-previous-line
+
+ "gg" 'beginning-of-buffer
+ "G" 'end-of-buffer
+
+ ;; open
+ (kbd "RET") 'archive-extract
+ (kbd "S-<return>") 'archive-extract-other-window
+ (kbd "M-<return>") 'archive-view
+ "go" 'archive-extract-other-window
+
+ "a" 'archive-alternate-display
+ "d" 'archive-flag-deleted
+ "r" 'archive-rename-entry
+ "x" 'archive-expunge
+ "M" 'archive-chmod-entry
+ "P" 'archive-chgrp-entry
+ "C" 'archive-chown-entry
+
+ ;; refresh
+ "gr" 'revert-buffer
+
+ ;; mark
+ "m" 'archive-mark
+ "u" 'archive-unflag
+ "U" 'archive-unmark-all-files
+
+ ;; quit
+ "q" 'quit-window))
+
+(provide 'evil-collection-arc-mode)
+;;; evil-collection-arc-mode.el ends here
diff --git a/modes/bookmark/evil-collection-bookmark.el b/modes/bookmark/evil-collection-bookmark.el
new file mode 100644
index 0000000..0256553
--- /dev/null
+++ b/modes/bookmark/evil-collection-bookmark.el
@@ -0,0 +1,79 @@
+;;; evil-collection-bookmark.el --- Evil bindings for bookmarks -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, bookmark, tools
+
+;; 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:
+;; Evil bindings for bookmarks.
+
+;;; Code:
+(require 'evil-collection)
+(require 'bookmark)
+
+(defconst evil-collection-bookmark-maps '(bookmark-bmenu-mode-map))
+
+;;;###autoload
+(defun evil-collection-bookmark-setup ()
+ "Set up `evil' bindings for `bookmark'."
+ (evil-set-initial-state 'bookmark-bmenu-mode 'normal)
+
+ (evil-collection-define-key 'normal 'bookmark-bmenu-mode-map
+ "q" 'quit-window
+ "gr" 'revert-buffer
+ "g?" 'describe-mode
+
+ "j" 'next-line
+ "p" 'previous-line
+ "J" 'bookmark-bmenu-this-window
+ "2" 'bookmark-bmenu-2-window
+ "1" 'bookmark-bmenu-1-window
+ "x" 'bookmark-bmenu-execute-deletions
+ "d" 'bookmark-bmenu-delete
+ "/" 'bookmark-bmenu-search
+ "r" 'bookmark-bmenu-rename
+ "R" 'bookmark-bmenu-relocate
+ "L" 'bookmark-bmenu-load
+ "t" 'bookmark-bmenu-toggle-filenames
+ "a" 'bookmark-bmenu-show-annotation
+ "A" 'bookmark-bmenu-show-all-annotations
+ "s" 'bookmark-bmenu-save
+ "W" 'bookmark-bmenu-locate
+ "E" 'bookmark-bmenu-edit-annotation
+ "D" 'bookmark-bmenu-delete-backwards
+
+ ;; mark
+ "u" 'bookmark-bmenu-unmark
+ "m" 'bookmark-bmenu-mark
+
+ ;; open
+ "o" 'bookmark-bmenu-select
+ "O" 'bookmark-bmenu-other-window
+ "go" 'bookmark-bmenu-other-window
+ "gO" 'bookmark-bmenu-switch-other-window
+ (kbd "RET") 'bookmark-bmenu-this-window
+ (kbd "S-<return>") 'bookmark-bmenu-other-window
+ (kbd "M-<return>") 'bookmark-bmenu-switch-other-window))
+
+
+(provide 'evil-collection-bookmark)
+;;; evil-collection-bookmark.el ends here
diff --git a/modes/buff-menu/evil-collection-buff-menu.el b/modes/buff-menu/evil-collection-buff-menu.el
new file mode 100644
index 0000000..8b377c7
--- /dev/null
+++ b/modes/buff-menu/evil-collection-buff-menu.el
@@ -0,0 +1,122 @@
+;;; evil-collection-buff-menu.el --- Bindings for `buff-menu'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;;; Bindings for `buff-menu'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'tabulated-list)
+
+;; `evil-collection-buff-menu-Buffer-menu-unmark-all'
+
+;; Code taken from emacs-26 repository.
+
+(defconst evil-collection-buff-menu-maps '(Buffer-menu-mode-map))
+
+;; This is for `evil-collection-Buffer-menu-unmark-all-buffers.'
+(defsubst evil-collection-buff-menu-tabulated-list-header-overlay-p (&optional pos)
+ "Return non-nil if there is a fake header.
+Optional arg POS is a buffer position where to look for a fake header;
+defaults to `point-min'."
+ (overlays-at (or pos (point-min))))
+
+(defun evil-collection-buff-menu-Buffer-menu-unmark-all ()
+ "Cancel all requested operations on buffers."
+ (interactive)
+ (evil-collection-buff-menu-Buffer-menu-unmark-all-buffers ?\r))
+
+(defun evil-collection-buff-menu-Buffer-menu-unmark-all-buffers (mark)
+ "Cancel a requested operation on all buffers.
+MARK is the character to flag the operation on the buffers.
+When called interactively prompt for MARK; RET remove all marks."
+ (interactive "cRemove marks (RET means all):")
+ (save-excursion
+ (goto-char (point-min))
+ (when (evil-collection-buff-menu-tabulated-list-header-overlay-p)
+ (forward-line))
+ (while (not (eobp))
+ (let ((xmarks (list (aref (tabulated-list-get-entry) 0)
+ (aref (tabulated-list-get-entry) 2))))
+ (when (or (char-equal mark ?\r)
+ (member (char-to-string mark) xmarks))
+ (Buffer-menu--unmark)))
+ (forward-line))))
+
+;; `evil-collection-buff-menu-Buffer-menu-unmark-all'
+
+;;;###autoload
+(defun evil-collection-buff-menu-setup ()
+ "Set up `evil' bindings for `buff-menu'.."
+
+ (evil-set-initial-state 'Buffer-menu-mode 'normal)
+ (evil-add-hjkl-bindings Buffer-menu-mode-map 'normal)
+
+ (evil-collection-define-key 'normal 'Buffer-menu-mode-map
+ "ZQ" 'evil-quit
+ "ZZ" 'quit-window
+ "gr" 'revert-buffer
+ "go" 'Buffer-menu-this-window
+ "gO" 'Buffer-menu-other-window
+ "d" 'Buffer-menu-delete
+ "s" 'Buffer-menu-save
+ [mouse-2] 'Buffer-menu-mouse-select
+ [follow-link] 'mouse-face
+ "x" 'Buffer-menu-execute
+ "o" 'tabulated-list-sort
+ "gv" 'Buffer-menu-select
+ "gV" 'Buffer-menu-view
+ "v" 'evil-visual-char
+
+ ;; mark
+ "u" 'Buffer-menu-unmark
+ "U" (if (< emacs-major-version 26)
+ 'evil-collection-buff-menu-Buffer-menu-unmark-all
+ 'Buffer-menu-unmark-all)
+ "m" 'Buffer-menu-mark
+
+ "f" 'evil-find-char
+ "e" 'evil-forward-word-end
+ "b" 'evil-backward-word-begin
+
+ "X" 'Buffer-menu-bury
+
+ ;; Default ones, unchanged. Redundant ones commented
+ "2" 'Buffer-menu-2-window
+ "1" 'Buffer-menu-1-window
+ (kbd "C-m") 'Buffer-menu-this-window
+ (kbd "C-k") 'Buffer-menu-delete
+ (kbd "C-d") 'Buffer-menu-delete-backwards
+ (kbd "<delete>") 'Buffer-menu-backup-unmark
+ "~" 'Buffer-menu-not-modified
+ "t" 'Buffer-menu-visit-tags-table
+ "%" 'Buffer-menu-toggle-read-only
+ "T" 'Buffer-menu-toggle-files-only
+ (kbd "M-s a C-s") 'Buffer-menu-isearch-buffers
+ (kbd "M-s a M-C-s") 'Buffer-menu-isearch-buffers-regexp
+ (kbd "M-s a C-o") 'Buffer-menu-multi-occur))
+
+(provide 'evil-collection-buff-menu)
+;;; evil-collection-buff-menu.el ends here
diff --git a/modes/calc/evil-collection-calc.el b/modes/calc/evil-collection-calc.el
new file mode 100644
index 0000000..3245fb4
--- /dev/null
+++ b/modes/calc/evil-collection-calc.el
@@ -0,0 +1,174 @@
+;;; evil-collection-calc.el --- Evil bindings for calc -*- lexical-binding: t -*-
+
+;; Copyright (C) 2018 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>, Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, calc, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for calc.
+
+;;; Code:
+(require 'evil-collection)
+(require 'calc)
+
+(defconst evil-collection-calc-maps '(calc-mode-map))
+
+;;;###autoload
+(defun evil-collection-calc-setup ()
+ "Set up `evil' bindings for `calc'."
+ (evil-collection-inhibit-insert-state 'calc-mode-map)
+ (evil-set-initial-state 'calc-mode 'normal)
+
+ ;; Calc sets up its bindings just-in-time for its "extensions". I don't think
+ ;; it's worth copying this clumsy design (for what performance benefit?),
+ ;; while making the bindings much harder to maintain.
+ (require 'calc-ext)
+
+ (evil-collection-define-key 'normal 'calc-mode-map
+ "0" 'calcDigit-start
+ "1" 'calcDigit-start
+ "2" 'calcDigit-start
+ "3" 'calcDigit-start
+ "4" 'calcDigit-start
+ "5" 'calcDigit-start
+ "6" 'calcDigit-start
+ "7" 'calcDigit-start
+ "8" 'calcDigit-start
+ "9" 'calcDigit-start
+
+ (kbd "<tab>") 'calc-roll-down
+ (kbd "S-<return>") 'calc-over
+ (kbd "RET") 'calc-enter
+ (kbd "SPC") 'calc-enter
+
+ (kbd "C-x C-t") 'calc-transpose-lines
+ (kbd "C-M-d") 'calc-pop-above
+ (kbd "C-M-i") 'calc-roll-up
+ (kbd "M-RET") 'calc-last-args
+ (kbd "C-M-w") 'kill-ring-save
+ (kbd "M-%") 'calc-percent
+ (kbd "M-k") 'calc-copy-as-kill
+ (kbd "M-w") 'calc-copy-region-as-kill
+ (kbd "M-DEL") 'calc-pop-above
+ (kbd "M-m t") 'calc-total-algebraic-mode
+ (kbd "<delete>") 'calc-pop
+ (kbd "<mouse-2>") 'calc-yank
+ "x" 'calc-pop ; was "C-d". TODO: Conflicts with calc-execute-extended-command.
+ "d" 'calc-kill ; was "C-k"
+ "u" 'calc-undo ; was "U"
+ "X" 'calc-call-last-kbd-macro ; "@" is already used.
+ "pp" 'calc-yank ; was "C-y"
+ "pP" 'calc-copy-to-buffer ; was "y"
+
+ (kbd "C-p") 'calc-precision ; was "p"
+
+ "?" 'calc-help
+ ;; "h" 'calc-help-prefix ; TODO: Rebind?
+ "i" 'calc-info
+
+ "\"" 'calc-auto-algebraic-entry
+ "$" 'calc-auto-algebraic-entry ; TODO: No need for this one?
+ "'" 'calc-algebraic-entry
+
+ "!" 'calc-factorial
+ "#" 'calcDigit-start
+ "%" 'calc-mod
+ "&" 'calc-inv
+ "(" 'calc-begin-complex
+ ")" 'calc-end-complex
+ "*" 'calc-times
+ "+" 'calc-plus
+ "," 'calc-comma
+ "-" 'calc-minus
+ "." 'calcDigit-start
+ "/" 'calc-divide
+ ":" 'calc-fdiv
+ ";" 'calc-semi ; TODO: Shall we really override `evil-ex'?
+ "<" 'calc-scroll-left
+ "=" 'calc-evaluate
+ ">" 'calc-scroll-right
+ "@" 'calcDigit-start
+ "A" 'calc-abs
+ "B" 'calc-log
+ "C" 'calc-cos
+ ;; "D" 'calc-redo ; TODO: What's the purpose of this? Bind to C-r?
+ "E" 'calc-exp
+ "F" 'calc-floor
+ "G" 'calc-argument
+ "H" 'calc-hyperbolic
+ "I" 'calc-inverse
+ "J" 'calc-conj
+ "K" 'calc-keep-args
+ "L" 'calc-ln
+ "M" 'calc-more-recursion-depth
+ "N" 'calc-eval-num
+ "O" 'calc-option
+ "P" 'calc-pi
+ "Q" 'calc-sqrt
+ "R" 'calc-round
+ "S" 'calc-sin
+ "T" 'calc-tan
+ "[[" 'calc-begin-vector
+ "]]" 'calc-end-vector
+ "\\" 'calc-idiv
+ "^" 'calc-power
+ "_" 'calcDigit-start
+ "`" 'calc-edit
+ "e" 'calcDigit-start
+ "n" 'calc-change-sign
+ "o" 'calc-realign
+ "w" 'calc-why
+ "x" 'calc-execute-extended-command ; TODO: Conflicts with calc-pop.
+ "|" 'calc-concat
+ "{" 'calc-scroll-down ; TODO: Not necessary?
+ "}" 'calc-scroll-up ; TODO: Not necessary?
+ "~" 'calc-num-prefix
+
+ "V" (lookup-key calc-mode-map (kbd "V"))
+ "Y" (lookup-key calc-mode-map (kbd "Y"))
+ "Z" (lookup-key calc-mode-map (kbd "Z"))
+ "a" (lookup-key calc-mode-map (kbd "a"))
+ "b" (lookup-key calc-mode-map (kbd "b"))
+ "c" (lookup-key calc-mode-map (kbd "c"))
+ "D" (lookup-key calc-mode-map (kbd "d"))
+ "f" (lookup-key calc-mode-map (kbd "f"))
+ "g" (lookup-key calc-mode-map (kbd "g"))
+ "zj" (lookup-key calc-mode-map (kbd "j"))
+ "zk" (lookup-key calc-mode-map (kbd "k"))
+ "zl" (lookup-key calc-mode-map (kbd "l"))
+ "m" (lookup-key calc-mode-map (kbd "m"))
+ "r" (lookup-key calc-mode-map (kbd "r"))
+ "s" (lookup-key calc-mode-map (kbd "s"))
+ "t" (lookup-key calc-mode-map (kbd "t"))
+ "U" (lookup-key calc-mode-map (kbd "u"))
+ "v" (lookup-key calc-mode-map (kbd "v"))
+ "zz" (lookup-key calc-mode-map (kbd "z"))
+
+ ;; quit
+ ;; "ZQ" 'quit-window ; TODO: Rebind "Z"?
+ ;; "ZZ" 'quit-window ; TODO: Rebind "Z"?
+ "q" 'calc-quit)
+
+ (evil-collection-define-key 'visual 'calc-mode-map
+ "d" 'calc-kill-region))
+
+(provide 'evil-collection-calc)
+;;; evil-collection-calc.el ends here
diff --git a/modes/calendar/evil-collection-calendar.el b/modes/calendar/evil-collection-calendar.el
new file mode 100644
index 0000000..58f73c6
--- /dev/null
+++ b/modes/calendar/evil-collection-calendar.el
@@ -0,0 +1,105 @@
+;;; evil-collection-calendar.el --- Evil bindings for calendar -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, calendar, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for the calendar.
+
+;;; Code:
+(require 'calendar)
+(require 'evil-collection)
+
+(defconst evil-collection-calendar-maps '(calendar-mode-map))
+
+;;;###autoload
+(defun evil-collection-calendar-setup ()
+ "Set up `evil' bindings for `calendar'."
+ (evil-set-initial-state 'calendar-mode 'normal)
+ (evil-collection-define-key 'normal 'calendar-mode-map
+ ;; motion
+ "h" 'calendar-backward-day
+ "j" 'calendar-forward-week
+ "k" 'calendar-backward-week
+ "l" 'calendar-forward-day
+ "0" 'calendar-beginning-of-week
+ "^" 'calendar-beginning-of-week
+ "$" 'calendar-end-of-week
+ "[[" 'calendar-backward-year
+ "]]" 'calendar-forward-year
+ (kbd "M-<") 'calendar-beginning-of-year
+ (kbd "M->") 'calendar-end-of-year
+ "(" 'calendar-beginning-of-month
+ ")" 'calendar-end-of-month
+ (kbd "SPC") 'scroll-other-window
+ (kbd "S-SPC") 'scroll-other-window-down
+ (kbd "<delete>") 'scroll-other-window-down
+ "<" 'calendar-scroll-right
+ ">" 'calendar-scroll-left
+ (kbd "C-b") 'calendar-scroll-right-three-months
+ (kbd "C-f") 'calendar-scroll-left-three-months
+ "{" 'calendar-backward-month
+ "}" 'calendar-forward-month
+ (kbd "C-k") 'calendar-backward-month
+ (kbd "C-j") 'calendar-forward-month
+ "gk" 'calendar-backward-month
+ "gj" 'calendar-forward-month
+
+ ;; visual
+ "v" 'calendar-set-mark
+
+ ;; goto
+ "." 'calendar-goto-today
+ "gd" 'calendar-goto-date ; "gd" in evil-org-agenda, "gd" in Emacs.
+ ;; "gD" 'calendar-other-month ; Not very useful if we have `calendar-goto-date'.
+
+ ;; diary
+ "D" 'diary-view-other-diary-entries
+ "d" 'diary-view-entries
+ "m" 'diary-mark-entries
+ "s" 'diary-show-all-entries
+
+ "u" 'calendar-unmark
+ "x" 'calendar-mark-holidays
+
+ ;; show
+ "gm" 'calendar-lunar-phases ; "gm" in evil-org-agenda. TODO: Shadows calendar-mayan.
+ "gs" 'calendar-sunrise-sunset ; "gs" in evil-org-agenda
+ "gh" 'calendar-list-holidays ; "gh" in evil-org-agenda. TODO: Shadows calendar-hebrew.
+ "gc" 'org-calendar-goto-agenda ; "gc" in evil-org-agenda. TODO: Shadows calendar-iso.
+ "r" 'calendar-cursor-holidays
+
+ ;; refresh
+ "gr" 'calendar-redraw
+
+ "g?" 'calendar-goto-info-node
+ "?" 'calendar-goto-info-node ; Search is not very useful.
+ (kbd "M-=") 'calendar-count-days-region
+
+ ;; quit
+ "q" 'calendar-exit
+ "ZQ" 'evil-quit
+ "ZZ" 'calendar-exit))
+
+(provide 'evil-collection-calendar)
+;;; evil-collection-calendar.el ends here
diff --git a/modes/cider/evil-collection-cider.el b/modes/cider/evil-collection-cider.el
new file mode 100644
index 0000000..5e9b2f0
--- /dev/null
+++ b/modes/cider/evil-collection-cider.el
@@ -0,0 +1,227 @@
+;;; evil-collection-cider.el --- Evil bindings for Cider -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, cider, tools
+
+;; 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:
+;; Evil bindings for Cider.
+
+;;; Code:
+(require 'cl-lib)
+(require 'cider nil t)
+(require 'evil-collection)
+
+(declare-function cider-debug-mode-send-reply "cider-debug")
+
+(defconst evil-collection-cider-maps '(cider-mode-map
+ cider-repl-mode-map
+ cider-repl-history-mode-map
+ cider-test-report-mode-map
+ cider-macroexpansion-mode-map
+ cider-connections-buffer-mode-map))
+
+(defun evil-collection-cider-last-sexp (command &rest args)
+ "In normal-state or motion-state, last sexp ends at point."
+ (if (and (not evil-move-beyond-eol)
+ (or (evil-normal-state-p) (evil-motion-state-p)))
+ (save-excursion
+ (unless (or (eobp) (eolp)) (forward-char))
+ (apply command args))
+ (apply command args)))
+
+(defmacro evil-collection-cider-make-debug-command (&rest cider-commands)
+ "Make functions that wrap `cider-debug' commands.
+
+Cider debug commands are sent through `cider-debug-mode-send-reply'.
+
+ex. \(cider-debug-mode-send-reply \":next\"\)"
+ (let ((commands (if (consp cider-commands)
+ cider-commands
+ (list cider-commands))))
+ `(progn
+ ,@(cl-loop
+ for command in commands
+ collect
+ (let ((funsymbol
+ (intern (format "evil-collection-cider-debug-%s" command))))
+ `(defun ,funsymbol ()
+ ,(format
+ "Send :%s to `cider-debug-mode-send-reply'." command)
+ (interactive)
+ (cider-debug-mode-send-reply ,(format ":%s" command))))))))
+
+(evil-collection-cider-make-debug-command "next"
+ "continue"
+ "out"
+ "quit"
+ "eval"
+ "inject"
+ "inspect"
+ "locals")
+
+;;;###autoload
+(defun evil-collection-cider-setup ()
+ "Set up `evil' bindings for `cider'."
+ (unless evil-move-beyond-eol
+ (advice-add 'cider-eval-last-sexp :around 'evil-collection-cider-last-sexp)
+ (advice-add 'cider-eval-last-sexp-and-replace :around 'evil-collection-cider-last-sexp)
+ (advice-add 'cider-eval-last-sexp-to-repl :around 'evil-collection-cider-last-sexp)
+ (with-eval-after-load 'cider-eval-sexp-fu
+ (advice-add 'cider-esf--bounds-of-last-sexp :around 'evil-collection-cider-last-sexp)))
+
+ (when evil-collection-setup-debugger-keys
+ (add-hook 'cider-mode-hook #'evil-normalize-keymaps)
+ (add-hook 'cider--debug-mode-hook #'evil-normalize-keymaps)
+ (evil-collection-define-key 'normal 'cider-mode-map
+ [f6] 'cider-browse-instrumented-defs
+ [f9] 'cider-debug-defun-at-point)
+
+ (evil-collection-define-key 'normal 'cider--debug-mode-map
+ "b" 'cider-debug-defun-at-point
+ "n" 'evil-collection-cider-debug-next
+ "c" 'evil-collection-cider-debug-continue
+ "o" 'evil-collection-cider-debug-out
+ "q" 'evil-collection-cider-debug-quit
+ "e" 'evil-collection-cider-debug-eval
+ "J" 'evil-collection-cider-debug-inject
+ "I" 'evil-collection-cider-debug-inspect
+ "L" 'evil-collection-cider-debug-locals
+ "H" 'cider-debug-move-here))
+
+ (evil-collection-define-key '(normal visual) 'cider-mode-map
+ "gd" 'cider-find-var
+ (kbd "C-t") 'cider-pop-back
+ "gz" 'cider-switch-to-repl-buffer
+ "gf" 'cider-find-resource
+ "K" 'cider-doc)
+
+ (evil-collection-define-key '(normal visual) 'cider-repl-mode-map
+ ;; FIXME: This seems to get overwritten by `cider-switch-to-repl-buffer'.
+ "gz" 'cider-switch-to-last-clojure-buffer
+
+ "gd" 'cider-find-var
+ (kbd "C-t") 'cider-pop-back
+ "gr" 'cider-refresh
+ "gf" 'cider-find-resource
+ "K" 'cider-doc)
+
+ (evil-collection-define-key '(normal visual) 'cider-repl-history-mode-map
+ (kbd "C-k") 'cider-repl-history-previous
+ (kbd "C-j") 'cider-repl-history-forward
+ "gk" 'cider-repl-history-previous
+ "gj" 'cider-repl-history-forward
+ "[[" 'cider-repl-history-previous
+ "]]" 'cider-repl-history-forward
+
+ (kbd "RET") 'cider-repl-history-insert-and-quit
+ "gr" 'cider-repl-history-update
+ "q" 'cider-repl-history-quit
+ "u" 'cider-repl-history-undo-other-window)
+
+ (evil-collection-define-key 'normal 'cider-test-report-mode-map
+ (kbd "C-c ,") 'cider-test-commands-map
+ (kbd "C-c C-t") 'cider-test-commands-map
+ (kbd "M-p") 'cider-test-previous-result
+ (kbd "M-n") 'cider-test-next-result
+
+ ;; goto
+ "gd" 'cider-test-jump
+
+ (kbd "<backtab>") 'cider-test-previous-result
+ (kbd "<tab>") 'cider-test-next-result
+ (kbd "RET") 'cider-test-jump
+ "t" 'cider-test-jump
+ "d" 'cider-test-ediff
+ "e" 'cider-test-stacktrace
+ "f" 'cider-test-rerun-failed-tests
+ "n" 'cider-test-run-ns-tests
+ "L" 'cider-test-run-loaded-tests
+ "p" 'cider-test-run-project-tests
+ "gr" 'cider-test-run-test
+ "q" 'cider-popup-buffer-quit-function)
+
+ (evil-collection-define-key 'normal 'cider-macroexpansion-mode-map
+ ;; quit
+ "q" 'cider-popup-buffer-quit-function
+
+ "r" 'cider-macroexpand-again
+ "K" 'cider-doc ; Evil has `evil-lookup'.
+ "J" 'cider-javadoc
+ "." 'cider-find-var
+ "m" 'cider-macroexpand-1-inplace
+ "a" 'cider-macroexpand-all-inplace
+ "u" 'cider-macroexpand-undo
+ [remap undo] 'cider-macroexpand-undo)
+
+ (evil-collection-define-key 'normal 'cider-connections-buffer-mode-map
+ "d" 'cider-connections-make-default
+ "c" 'cider-connection-browser
+ "x" 'cider-connections-close-connection
+ (kbd "RET") 'cider-connections-goto-connection
+ "g?" 'describe-mode)
+
+ (evil-set-initial-state 'cider-stacktrace-mode 'normal)
+ (evil-collection-define-key 'normal 'cider-stacktrace-mode-map
+ (kbd "C-k") 'cider-stacktrace-previous-cause
+ (kbd "C-j") 'cider-stacktrace-next-cause
+ (kbd "gk") 'cider-stacktrace-previous-cause
+ (kbd "gj") 'cider-stacktrace-next-cause
+ (kbd "[[") 'cider-stacktrace-previous-cause
+ (kbd "]]") 'cider-stacktrace-next-cause
+ "gd" 'cider-stacktrace-jump
+ "q" 'cider-popup-buffer-quit-function
+ "J" 'cider-stacktrace-toggle-java
+ "C" 'cider-stacktrace-toggle-clj
+ "R" 'cider-stacktrace-toggle-repl
+ "T" 'cider-stacktrace-toggle-tooling
+ "D" 'cider-stacktrace-toggle-duplicates
+ "P" 'cider-stacktrace-show-only-project
+ "A" 'cider-stacktrace-toggle-all
+ "1" 'cider-stacktrace-cycle-cause-1
+ "2" 'cider-stacktrace-cycle-cause-2
+ "3" 'cider-stacktrace-cycle-cause-3
+ "4" 'cider-stacktrace-cycle-cause-4
+ "5" 'cider-stacktrace-cycle-cause-5
+ "0" 'cider-stacktrace-cycle-all-causes
+ (kbd "TAB") 'cider-stacktrace-cycle-current-cause
+ [backtab] 'cider-stacktrace-cycle-all-causes)
+
+ (add-hook 'cider-inspector-mode-hook #'evil-normalize-keymaps)
+ (evil-collection-define-key 'normal 'cider-inspector-mode-map
+ "q" 'quit-window
+ (kbd "RET") 'cider-inspector-operate-on-point
+ [mouse-1] 'cider-inspector-operate-on-click
+ "L" 'cider-inspector-pop
+ "gr" 'cider-inspector-refresh
+ ;; Page-up/down
+ (kbd "C-j") 'cider-inspector-next-page
+ (kbd "C-k") 'cider-inspector-prev-page
+ " " 'cider-inspector-next-page
+ "s" 'cider-inspector-set-page-size
+ (kbd "]]") 'cider-inspector-next-inspectable-object
+ (kbd "[[") 'cider-inspector-previous-inspectable-object
+ "gj" 'cider-inspector-next-inspectable-object
+ "gk" 'cider-inspector-previous-inspectable-object))
+
+(provide 'evil-collection-cider)
+;;; evil-collection-cider.el ends here
diff --git a/modes/cmake-mode/evil-collection-cmake-mode.el b/modes/cmake-mode/evil-collection-cmake-mode.el
new file mode 100644
index 0000000..7c8f24d
--- /dev/null
+++ b/modes/cmake-mode/evil-collection-cmake-mode.el
@@ -0,0 +1,44 @@
+;;; evil-collection-cmake-mode.el --- Bindings for `cmake-mode' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;;; Bindings for `cmake-mode'
+
+;;; Code:
+(require 'evil-collection)
+(require 'cmake-mode nil t)
+
+(defvar cmake-tab-width)
+(defun evil-collection-cmake-mode-set-evil-shift-width ()
+ "Set `evil-shift-width' according to `cmake-tab-with'."
+ (setq-local evil-shift-width cmake-tab-width))
+
+;;;###autoload
+(defun evil-collection-cmake-mode-setup ()
+ "Set up `evil' bindings for `cmake-mode'."
+ (add-hook 'cmake-mode-hook #'evil-collection-cmake-mode-set-evil-shift-width))
+
+(provide 'evil-collection-cmake-mode)
+;;; evil-collection-cmake-mode.el ends here
diff --git a/modes/comint/evil-collection-comint.el b/modes/comint/evil-collection-comint.el
new file mode 100644
index 0000000..2901e92
--- /dev/null
+++ b/modes/comint/evil-collection-comint.el
@@ -0,0 +1,58 @@
+;;; evil-collection-comint.el --- Bindings for `comint-mode'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, comint, processes
+
+;; 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:
+;;; Bindings for `comint-mode'.
+
+;;; Code:
+(require 'comint)
+(require 'evil-collection)
+
+(defconst evil-collection-comint-maps '(comint-mode-map))
+
+;;;###autoload
+(defun evil-collection-comint-setup ()
+ "Set up `evil' bindings for `comint'."
+ (when evil-want-C-d-scroll
+ (evil-collection-define-key 'normal 'comint-mode-map
+ (kbd "C-d") #'evil-scroll-down))
+
+ (evil-collection-define-key 'normal 'comint-mode-map
+ ;; Match Eshell bindings:
+ (kbd "C-j") #'comint-next-prompt
+ (kbd "C-k") #'comint-previous-prompt
+ (kbd "gj") #'comint-next-prompt
+ (kbd "gk") #'comint-previous-prompt
+ (kbd "]]") #'comint-next-prompt
+ (kbd "[[") #'comint-previous-prompt
+ (kbd "C-p") #'comint-previous-input
+ (kbd "C-n") #'comint-next-input)
+
+ (evil-collection-define-key 'insert 'comint-mode-map
+ (kbd "<up>") #'comint-previous-input
+ (kbd "<down>") #'comint-next-input))
+
+(provide 'evil-collection-comint)
+;;; evil-collection-comint.el ends here
diff --git a/modes/company/evil-collection-company.el b/modes/company/evil-collection-company.el
new file mode 100644
index 0000000..4b8e072
--- /dev/null
+++ b/modes/company/evil-collection-company.el
@@ -0,0 +1,83 @@
+;;; evil-collection-company.el --- Bindings for `company-mode'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, company, abbrev, convenience, matching
+
+;; 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:
+;;; Bindings for `company-mode'.
+
+;;; Code:
+(require 'company nil t)
+(require 'evil-collection)
+
+(declare-function company-tng-configure-default "company-tng")
+
+(defgroup evil-collection-company nil
+ "Evil bindings for `company-mode'."
+ :group 'evil-collection)
+
+(defcustom evil-collection-company-use-tng t
+ "Enable company-tng through `company-tng-configure-default'.
+
+This mirrors ycmd's behavior for a completion experience more
+similar to YouCompleteMe.
+
+Note that for changes to take effect, this variable may have to
+be set through custom or before evil-collection loads."
+ :group 'evil-collection-company
+ :type 'boolean)
+
+(defvar company-active-map)
+(defvar company-search-map)
+
+(defconst evil-collection-company-maps '(company-active-map company-search-map))
+
+;;;###autoload
+(defun evil-collection-company-setup ()
+ "Set up `evil' bindings for `company'."
+ (evil-collection-define-key nil 'company-active-map
+ (kbd "C-n") 'company-select-next-or-abort
+ (kbd "C-p") 'company-select-previous-or-abort
+ (kbd "C-j") 'company-select-next-or-abort
+ (kbd "C-k") 'company-select-previous-or-abort
+ (kbd "M-j") 'company-select-next
+ (kbd "M-k") 'company-select-previous)
+
+ (when evil-want-C-u-scroll
+ (evil-collection-define-key nil 'company-active-map (kbd "C-u") 'company-previous-page))
+
+ (when evil-want-C-d-scroll
+ (evil-collection-define-key nil 'company-active-map (kbd "C-d") 'company-next-page))
+
+ (evil-collection-define-key nil 'company-search-map
+ (kbd "C-j") 'company-select-next-or-abort
+ (kbd "C-k") 'company-select-previous-or-abort
+ (kbd "M-j") 'company-select-next
+ (kbd "M-k") 'company-select-previous
+ (kbd "<escape>") 'company-search-abort)
+
+ ;; Sets up YCMD like behavior.
+ (when evil-collection-company-use-tng (company-tng-configure-default)))
+
+(provide 'evil-collection-company)
+;;; evil-collection-company.el ends here
diff --git a/modes/compile/evil-collection-compile.el b/modes/compile/evil-collection-compile.el
new file mode 100644
index 0000000..c59a916
--- /dev/null
+++ b/modes/compile/evil-collection-compile.el
@@ -0,0 +1,61 @@
+;;; evil-collection-compile.el --- Evil bindings for `compile' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, compile, tools
+
+;; 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:
+;; Evil bindings for `compile'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'compile)
+
+(defconst evil-collection-compile-maps '(compilation-mode-map))
+
+;;;###autoload
+(defun evil-collection-compile-setup ()
+ "Set up `evil' bindings for `compile'."
+ (evil-set-initial-state 'compilation-mode 'normal)
+
+ (evil-collection-define-key 'normal 'compilation-mode-map
+ "g?" 'describe-mode
+ "?" evil-collection-evil-search-backward
+ "gg" 'evil-goto-first-line
+ "0" 'evil-digit-argument-or-evil-beginning-of-line
+ [mouse-2] 'compile-goto-error
+ [follow-link] 'mouse-face
+ (kbd "RET") 'compile-goto-error
+
+ "go" 'compilation-display-error
+ (kbd "S-<return>") 'compilation-display-error
+
+ "gj" 'compilation-next-error
+ "gk" 'compilation-previous-error
+ (kbd "C-j") 'compilation-next-error
+ (kbd "C-k") 'compilation-previous-error
+ "[[" 'compilation-previous-file
+ "]]" 'compilation-next-file
+ "gr" 'recompile))
+
+(provide 'evil-collection-compile)
+;;; evil-collection-compile.el ends here
diff --git a/modes/cus-theme/evil-collection-cus-theme.el b/modes/cus-theme/evil-collection-cus-theme.el
new file mode 100644
index 0000000..10373b4
--- /dev/null
+++ b/modes/cus-theme/evil-collection-cus-theme.el
@@ -0,0 +1,65 @@
+;;; evil-collection-cus-theme.el --- Bindings for `cus-theme'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, custom themes, help, faces
+
+;; 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:
+;;; Bindings for `cus-theme'.
+
+;;; Code:
+(require 'cus-theme)
+(require 'evil-collection)
+
+(defconst evil-collection-cus-theme-maps '(custom-theme-choose-mode-map
+ custom-new-theme-mode-map))
+
+;;;###autoload
+(defun evil-collection-cus-theme-setup ()
+ "Set up `evil' bindings for `cus-theme'."
+ (evil-set-initial-state 'custom-new-theme-mode 'normal)
+ (evil-set-initial-state 'custom-theme-choose-mode 'normal)
+
+ (evil-collection-define-key 'normal 'custom-theme-choose-mode-map
+ "gj" 'widget-forward
+ "gk" 'widget-backward
+ (kbd "]]") 'widget-forward
+ (kbd "[[") 'widget-backward
+ (kbd "C-j") 'widget-forward
+ (kbd "C-k") 'widget-backward
+ "K" 'custom-describe-theme)
+
+ (evil-collection-define-key 'normal 'custom-new-theme-mode-map
+ "gj" 'widget-forward
+ "gk" 'widget-backward
+ (kbd "]]") 'widget-forward
+ (kbd "[[") 'widget-backward
+ (kbd "C-j") 'widget-forward
+ (kbd "C-k") 'widget-backward
+
+ ;; quit
+ "q" 'Custom-buffer-done
+ "ZQ" 'evil-quit
+ "ZZ" 'Custom-buffer-done))
+
+(provide 'evil-collection-cus-theme)
+;;; evil-collection-cus-theme.el ends here
diff --git a/modes/custom/evil-collection-custom.el b/modes/custom/evil-collection-custom.el
new file mode 100644
index 0000000..1fecbde
--- /dev/null
+++ b/modes/custom/evil-collection-custom.el
@@ -0,0 +1,68 @@
+;;; evil-collection-custom.el --- Evil bindings for Customize -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, custom, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for the Customize interface.
+
+;;; Code:
+(require 'cus-edit)
+(require 'evil-collection)
+
+(defconst evil-collection-custom-maps '(custom-mode-map))
+
+;;;###autoload
+(defun evil-collection-custom-setup ()
+ "Set up `evil' bindings for `Custom-mode'."
+ (evil-set-initial-state 'Custom-mode 'normal)
+
+ (evil-collection-define-key 'normal 'custom-mode-map
+ ;; motion
+ (kbd "<tab>") 'widget-forward
+ (kbd "S-<tab>") 'widget-backward
+ (kbd "<backtab>") 'widget-backward
+ (kbd "SPC") 'scroll-up-command
+ (kbd "S-SPC") 'scroll-down-command
+ (kbd "<delete>") 'scroll-down-command
+ (kbd "RET") 'Custom-newline
+ (kbd "]]") 'widget-forward
+ (kbd "[[") 'widget-backward
+ ;; TODO: Should the following be added?
+ (kbd "C-j") 'widget-forward
+ (kbd "C-k") 'widget-backward
+ "gj" 'widget-forward
+ "gk" 'widget-backward
+
+ "^" 'Custom-goto-parent
+ (kbd "C-o") 'Custom-goto-parent
+ ;; TODO: Should the following be added?
+ "<" 'Custom-goto-parent
+
+ ;; quit
+ "q" 'Custom-buffer-done
+ "ZQ" 'evil-quit
+ "ZZ" 'Custom-buffer-done))
+
+(provide 'evil-collection-custom)
+;;; evil-collection-custom.el ends here
diff --git a/modes/daemons/evil-collection-daemons.el b/modes/daemons/evil-collection-daemons.el
new file mode 100644
index 0000000..5222dfc
--- /dev/null
+++ b/modes/daemons/evil-collection-daemons.el
@@ -0,0 +1,68 @@
+;;; evil-collection-daemons.el --- Evil Bindings for Daemons -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: Jay Kamat <jaygkamat@gmail.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, daemons, tools
+
+;; 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:
+;; Evil bindings for `daemons' from the `daemons.el' package.
+
+;;; Code:
+(require 'daemons nil t)
+(require 'evil-collection)
+
+(defconst evil-collection-daemons-maps '(daemons-mode-map
+ daemons-output-mode-map))
+
+;;;###autoload
+(defun evil-collection-daemons-setup ()
+ "Set up `evil' bindings for `daemons'."
+ (evil-collection-define-key '(normal visual) 'daemons-mode-map
+ (kbd "RET") 'daemons-status-at-point
+ "s" 'daemons-start-at-point
+ "S" 'daemons-stop-at-point
+ "r" 'daemons-reload-at-point
+ "R" 'daemons-restart-at-point
+
+ "gr" 'revert-buffer
+
+ "q" 'quit-window
+ "ZZ" 'quit-window
+ "ZQ" 'quit-window)
+
+ ;; Functions are available in daemons-output-mode-map as well
+ (evil-collection-define-key '(normal visual) 'daemons-output-mode-map
+ (kbd "RET") 'daemons-status-at-point
+ "s" 'daemons-start-at-point
+ "S" 'daemons-stop-at-point
+ "r" 'daemons-reload-at-point
+ "R" 'daemons-restart-at-point
+
+ "q" 'quit-window
+ "ZZ" 'quit-window
+ "ZQ" 'quit-window)
+
+ (evil-set-initial-state 'daemons-mode 'normal)
+ (evil-set-initial-state 'daemons-output-mode 'normal))
+
+(provide 'evil-collection-daemons)
+;;; evil-collection-daemons.el ends here
diff --git a/modes/debbugs/evil-collection-debbugs.el b/modes/debbugs/evil-collection-debbugs.el
new file mode 100644
index 0000000..8d3fb2b
--- /dev/null
+++ b/modes/debbugs/evil-collection-debbugs.el
@@ -0,0 +1,81 @@
+;;; evil-collection-debbugs.el --- Evil bindings for debbugs -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, debbugs, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for debbugs.
+
+;;; Code:
+(require 'debbugs nil t)
+(require 'evil-collection)
+
+(defconst evil-collection-debbugs-maps '(debbugs-gnu-mode-map))
+
+;;;###autoload
+(defun evil-collection-debbugs-setup ()
+ "Set up `evil' bindings for `debbugs-gnu-mode'."
+ (evil-set-initial-state 'debbugs-gnu-mode 'normal)
+
+ (evil-collection-define-key 'normal 'debbugs-gnu-mode-map
+ ;; motion
+ (kbd "<tab>") 'forward-button
+ (kbd "<backtab>") 'backward-button
+ (kbd "SPC") 'scroll-up-command
+
+ (kbd "RET") 'debbugs-gnu-select-report
+ "c" 'debbugs-gnu-send-control-message
+ "d" 'debbugs-gnu-display-status
+
+ ;; filter
+ "s" 'debbugs-gnu-narrow-to-status
+ "S" 'debbugs-gnu-search
+ ;; "S" 'debbugs-gnu-widen ; Useless if we can just press "s RET" (empty filter).
+ "x" 'debbugs-gnu-toggle-suppress
+ "r" 'debbugs-gnu-show-all-blocking-reports
+
+ ;; sort
+ "o" 'debbugs-gnu-toggle-sort
+ "O" 'tabulated-list-sort
+
+ ;; show
+ "gB" 'debbugs-gnu-show-blocking-reports
+ "gb" 'debbugs-gnu-show-blocked-by-reports
+
+ ;; mark
+ "m" 'debbugs-gnu-toggle-tag
+
+ ;; refresh
+ "gr" 'debbugs-gnu-rescan
+
+ "g?" 'debbugs-gnu-manual
+ "gt" 'debbugs-gnu-view-bug-triage
+ "g#" 'debbugs-gnu-bugs
+
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'quit-window
+ "ZZ" 'quit-window))
+
+(provide 'evil-collection-debbugs)
+;;; evil-collection-debbugs.el ends here
diff --git a/modes/debug/evil-collection-debug.el b/modes/debug/evil-collection-debug.el
new file mode 100644
index 0000000..a75f097
--- /dev/null
+++ b/modes/debug/evil-collection-debug.el
@@ -0,0 +1,72 @@
+;;; evil-collection-debug.el --- Evil bindings for the debugger -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, debug, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for the debugger.
+
+;;; Code:
+
+(require 'evil-collection)
+(require 'debug)
+
+(defconst evil-collection-debug-maps '(debugger-mode-map))
+
+;;;###autoload
+(defun evil-collection-debug-setup ()
+ "Set up `evil' bindings for `debug'."
+ (evil-set-initial-state 'debugger-mode 'normal)
+
+ (evil-collection-define-key 'normal 'debugger-mode-map
+ ;; motion
+ (kbd "<tab>") 'forward-button
+ (kbd "S-<tab>") 'backward-button
+ (kbd "RET") (if (< emacs-major-version 27)
+ 'debug-help-follow
+ 'backtrace-help-follow-symbol)
+ (kbd "SPC") 'next-line
+
+ "R" 'debugger-record-expression
+ "c" 'debugger-continue
+ "d" 'debugger-step-through
+
+ "x" 'debugger-eval-expression
+ "E" 'debugger-eval-expression
+
+ "J" 'debugger-jump
+
+ "gl" 'debugger-list-functions
+ "gb" 'debugger-frame
+ "r" 'debugger-return-value
+ "u" 'debugger-frame-clear
+ "L" 'debugger-toggle-locals
+ "p" 'debugger-toggle-locals
+
+ ;; quit
+ "q" 'top-level
+ "ZQ" 'evil-quit
+ "ZZ" 'top-level))
+
+(provide 'evil-collection-debug)
+;;; evil-collection-debug.el ends here
diff --git a/modes/diff-mode/evil-collection-diff-mode.el b/modes/diff-mode/evil-collection-diff-mode.el
new file mode 100644
index 0000000..7b5165f
--- /dev/null
+++ b/modes/diff-mode/evil-collection-diff-mode.el
@@ -0,0 +1,147 @@
+;;; evil-collection-diff-mode.el --- Add Evil bindings to diff-mode -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, diff, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Evil-Collection-Diff re-uses the read-only particularity of `diff-mode':
+;; When the buffer is read-only, enter motion state
+;; and manipulate the diffs with simple bindings.
+;; When the buffer is writage, use normal/insert states with some Evil-specific
+;; keys to ease navigation.
+;;
+;; See also `evil-collection-diff-toggle-setup'.
+
+;;; Code:
+
+(require 'evil-collection)
+(require 'diff-mode)
+
+(defconst evil-collection-diff-mode-maps '(diff-mode-map))
+
+(defun evil-collection-diff-read-only-state-switch ()
+ "Make read-only in motion state, writable in normal state."
+ (when (eq major-mode 'diff-mode)
+ (if buffer-read-only
+ (evil-motion-state)
+ (evil-normal-state))))
+
+;;;###autoload
+(defun evil-collection-diff-toggle-setup ()
+ "Toggle visiting diff buffers in motion state."
+ (interactive)
+ (when (eq major-mode 'diff-mode)
+ (if (memq 'evil-collection-diff-read-only-state-switch read-only-mode-hook)
+ (remove-hook 'read-only-mode-hook 'evil-collection-diff-read-only-state-switch t)
+ (add-hook 'read-only-mode-hook 'evil-collection-diff-read-only-state-switch nil t))))
+
+;;; TODO: Report toggle function upstream?
+(defun evil-collection-diff-toggle-context-unified (start end)
+ "Toggle between context and unified views.
+
+START and END are either taken from the region (if a prefix arg is given) or
+else cover the whole buffer."
+ (interactive (if (or current-prefix-arg (use-region-p))
+ (list (region-beginning) (region-end))
+ (list (point-min) (point-max))))
+ ;; There seems to be no way to know whether we are in context or unified views.
+ ;; Workaround: assume that point-max will change. This is brittle.
+ (let ((old-point-max (point-max)))
+ (diff-unified->context start end)
+ (when (= old-point-max (point-max))
+ (diff-context->unified start end))))
+
+;;; TODO: Report toggle function upstream?
+(defun evil-collection-diff-toggle-restrict-view (&optional arg)
+ "Toggle the restriction of the view to the current hunk.
+When restricting and if the prefix ARG is given, restrict the view to the
+current file instead."
+ (interactive "P")
+ (if (buffer-narrowed-p)
+ (widen)
+ (diff-restrict-view arg)))
+
+;;;###autoload
+(defun evil-collection-diff-mode-setup ()
+ "Set up `evil' bindings for `diff-mode'."
+
+ ;; Don't switch to read-only/motion state by default as this can interfere
+ ;; with other modes which require a writable buffer, e.g. magit.
+ (evil-set-initial-state 'diff-mode 'normal)
+
+ (evil-collection-define-key 'normal 'diff-mode-map
+ ;; motion
+ (kbd "SPC") 'scroll-up-command
+ (kbd "S-SPC") 'scroll-down-command
+ (kbd "[[") 'diff-file-prev
+ (kbd "]]") 'diff-file-next
+ (kbd "C-j") 'diff-hunk-next
+ (kbd "C-k") 'diff-hunk-prev
+ "gj" 'diff-hunk-next
+ "gk" 'diff-hunk-prev
+
+ "q" 'quit-window
+
+ "\\" 'read-only-mode) ; magit has "\"
+
+ (evil-collection-define-key 'motion 'diff-mode-map
+ ;; motion
+ (kbd "SPC") 'scroll-up-command
+ (kbd "S-SPC") 'scroll-down-command
+ (kbd "[[") 'diff-file-prev
+ (kbd "]]") 'diff-file-next
+ (kbd "C-j") 'diff-hunk-next
+ (kbd "C-k") 'diff-hunk-prev
+ "gj" 'diff-hunk-next
+ "gk" 'diff-hunk-prev
+
+ (kbd "RET") 'diff-goto-source
+ "A" 'diff-add-change-log-entries-other-window
+
+ "a" 'diff-apply-hunk
+ "*" 'diff-refine-hunk
+ "D" 'diff-file-kill
+ "d" 'diff-hunk-kill
+
+ "ge" 'diff-ediff-patch
+ "i" 'next-error-follow-minor-mode
+ "o" 'evil-collection-diff-toggle-restrict-view
+ "~" 'diff-reverse-direction
+ "s" 'diff-split-hunk
+ "c" 'diff-test-hunk
+ "x" 'evil-collection-diff-toggle-context-unified
+ "#" 'diff-ignore-whitespace-hunk
+
+ "\\" 'read-only-mode)) ; magit has "\"
+
+
+
+(add-hook 'diff-mode-hook 'evil-collection-diff-toggle-setup)
+
+(defun evil-collection-diff-unload-function ()
+ "For `unload-feature'."
+ (remove-hook 'diff-mode-hook 'evil-collection-diff-toggle-setup))
+
+(provide 'evil-collection-diff-mode)
+;;; evil-collection-diff-mode.el ends here
diff --git a/modes/dired/evil-collection-dired.el b/modes/dired/evil-collection-dired.el
new file mode 100644
index 0000000..41cbaeb
--- /dev/null
+++ b/modes/dired/evil-collection-dired.el
@@ -0,0 +1,192 @@
+;;; evil-collection-dired.el --- Evil bindings for Dired -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, dired, tools
+
+;; 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:
+;; Evil bindings for Dired.
+
+;;; Code:
+(require 'dired)
+(require 'evil-collection)
+
+(defconst evil-collection-dired-maps '(dired-mode-map))
+
+;;;###autoload
+(defun evil-collection-dired-setup ()
+ "Set up `evil' bindings for `dired'."
+ (evil-collection-define-key 'normal 'dired-mode-map
+ "q" 'quit-window
+ "j" 'dired-next-line
+ "k" 'dired-previous-line
+ [mouse-2] 'dired-mouse-find-file-other-window
+ [follow-link] 'mouse-face
+ ;; Commands to mark or flag certain categories of files
+ "#" 'dired-flag-auto-save-files
+ "." 'dired-clean-directory
+ "~" 'dired-flag-backup-files
+ ;; Upper case keys (except !) for operating on the marked files
+ "A" 'dired-do-find-regexp
+ "C" 'dired-do-copy
+ "B" 'dired-do-byte-compile
+ "D" 'dired-do-delete
+ "gG" 'dired-do-chgrp ;; FIXME: This can probably live on a better binding.
+ "H" 'dired-do-hardlink
+ "L" 'dired-do-load
+ "M" 'dired-do-chmod
+ "O" 'dired-do-chown
+ "P" 'dired-do-print
+ "Q" 'dired-do-find-regexp-and-replace
+ "R" 'dired-do-rename
+ "S" 'dired-do-symlink
+ "T" 'dired-do-touch
+ "X" 'dired-do-shell-command
+ "Z" 'dired-do-compress
+ "c" 'dired-do-compress-to
+ "!" 'dired-do-shell-command
+ "&" 'dired-do-async-shell-command
+ ;; Comparison commands
+ "=" 'dired-diff
+ ;; Tree Dired commands
+ (kbd "M-C-?") 'dired-unmark-all-files
+ (kbd "M-C-d") 'dired-tree-down
+ (kbd "M-C-u") 'dired-tree-up
+ (kbd "M-C-n") 'dired-next-subdir
+ (kbd "M-C-p") 'dired-prev-subdir
+ ;; move to marked files
+ (kbd "M-{") 'dired-prev-marked-file
+ (kbd "M-}") 'dired-next-marked-file
+ ;; Make all regexp commands share a `%' prefix:
+ ;; We used to get to the submap via a symbol dired-regexp-prefix,
+ ;; but that seems to serve little purpose, and copy-keymap
+ ;; does a better job without it.
+ "%" nil
+ "%u" 'dired-upcase
+ "%l" 'dired-downcase
+ "%d" 'dired-flag-files-regexp
+ "%g" 'dired-mark-files-containing-regexp
+ "%m" 'dired-mark-files-regexp
+ "%r" 'dired-do-rename-regexp
+ "%C" 'dired-do-copy-regexp
+ "%H" 'dired-do-hardlink-regexp
+ "%R" 'dired-do-rename-regexp
+ "%S" 'dired-do-symlink-regexp
+ "%&" 'dired-flag-garbage-files
+ ;; mark
+ "*" nil
+ "**" 'dired-mark-executables
+ "*/" 'dired-mark-directories
+ "*@" 'dired-mark-symlinks
+ "*%" 'dired-mark-files-regexp
+ "*(" 'dired-mark-sexp
+ "*." 'dired-mark-extension
+ "*O" 'dired-mark-omitted
+ "*c" 'dired-change-marks
+ "*s" 'dired-mark-subdir-files
+ "*m" 'dired-mark
+ "*u" 'dired-unmark
+ "*?" 'dired-unmark-all-files
+ "*!" 'dired-unmark-all-marks
+ "U" 'dired-unmark-all-marks
+ (kbd "* <delete>") 'dired-unmark-backward
+ (kbd "* C-n") 'dired-next-marked-file
+ (kbd "* C-p") 'dired-prev-marked-file
+ "*t" 'dired-toggle-marks
+ ;; Lower keys for commands not operating on all the marked files
+ "a" 'dired-find-alternate-file
+ "d" 'dired-flag-file-deletion
+ "gf" 'dired-find-file
+ (kbd "C-m") 'dired-find-file
+ "gr" 'revert-buffer
+ "i" 'dired-toggle-read-only
+ "I" 'dired-maybe-insert-subdir
+ "J" 'dired-goto-file
+ "K" 'dired-do-kill-lines
+ "r" 'dired-do-redisplay
+ "m" 'dired-mark
+ "t" 'dired-toggle-marks
+ "u" 'dired-unmark ; also "*u"
+ "W" 'browse-url-of-dired-file
+ "x" 'dired-do-flagged-delete
+ "gy" 'dired-show-file-type ;; FIXME: This could probably go on a better key.
+ "Y" 'dired-copy-filename-as-kill
+ "+" 'dired-create-directory
+ ;; open
+ (kbd "RET") 'dired-find-file
+ (kbd "S-<return>") 'dired-find-file-other-window
+ (kbd "M-<return>") 'dired-display-file
+ "gO" 'dired-find-file-other-window
+ "go" 'dired-view-file
+ ;; sort
+ "o" 'dired-sort-toggle-or-edit
+ ;; moving
+ "gj" 'dired-next-dirline
+ "gk" 'dired-prev-dirline
+ "[[" 'dired-prev-dirline
+ "]]" 'dired-next-dirline
+ "<" 'dired-prev-dirline
+ ">" 'dired-next-dirline
+ "^" 'dired-up-directory
+ "-" 'dired-up-directory
+ " " 'dired-next-line
+ [?\S-\ ] 'dired-previous-line
+ [remap next-line] 'dired-next-line
+ [remap previous-line] 'dired-previous-line
+ ;; hiding
+ "g$" 'dired-hide-subdir ;; FIXME: This can probably live on a better binding.
+ (kbd "M-$") 'dired-hide-all
+ "(" 'dired-hide-details-mode
+ ;; isearch
+ (kbd "M-s a C-s") 'dired-do-isearch
+ (kbd "M-s a M-C-s") 'dired-do-isearch-regexp
+ (kbd "M-s f C-s") 'dired-isearch-filenames
+ (kbd "M-s f M-C-s") 'dired-isearch-filenames-regexp
+ ;; misc
+ [remap read-only-mode] 'dired-toggle-read-only
+ ;; `toggle-read-only' is an obsolete alias for `read-only-mode'
+ [remap toggle-read-only] 'dired-toggle-read-only
+ "g?" 'dired-summary
+ (kbd "<delete>") 'dired-unmark-backward
+ [remap undo] 'dired-undo
+ [remap advertised-undo] 'dired-undo
+ ;; thumbnail manipulation (image-dired)
+ (kbd "C-t d") 'image-dired-display-thumbs
+ (kbd "C-t t") 'image-dired-tag-files
+ (kbd "C-t r") 'image-dired-delete-tag
+ (kbd "C-t j") 'image-dired-jump-thumbnail-buffer
+ (kbd "C-t i") 'image-dired-dired-display-image
+ (kbd "C-t x") 'image-dired-dired-display-external
+ (kbd "C-t a") 'image-dired-display-thumbs-append
+ (kbd "C-t .") 'image-dired-display-thumb
+ (kbd "C-t c") 'image-dired-dired-comment-files
+ (kbd "C-t f") 'image-dired-mark-tagged-files
+ (kbd "C-t C-t") 'image-dired-dired-toggle-marked-thumbs
+ (kbd "C-t e") 'image-dired-dired-edit-comment-and-tags
+ ;; encryption and decryption (epa-dired)
+ ";d" 'epa-dired-do-decrypt
+ ";v" 'epa-dired-do-verify
+ ";s" 'epa-dired-do-sign
+ ";e" 'epa-dired-do-encrypt))
+
+(provide 'evil-collection-dired)
+;;; evil-collection-dired.el ends here
diff --git a/modes/doc-view/evil-collection-doc-view.el b/modes/doc-view/evil-collection-doc-view.el
new file mode 100644
index 0000000..0ce61c6
--- /dev/null
+++ b/modes/doc-view/evil-collection-doc-view.el
@@ -0,0 +1,84 @@
+;;; evil-collection-doc-view.el --- Evil bindings for docview. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, bindings, files, pdf, ps, dvi
+
+;; 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:
+;;; Evil bindings for doc-view.
+
+;;; Code:
+(require 'evil-collection)
+(require 'doc-view)
+
+(defconst evil-collection-doc-view-maps '(doc-view-mode-map))
+
+;;;###autoload
+(defun evil-collection-doc-view-setup ()
+ "Set up `evil' bindings for `doc-view'."
+ (evil-set-initial-state 'doc-view-mode 'normal)
+ (evil-collection-define-key 'normal 'doc-view-mode-map
+ "q" 'quit-window
+ (kbd "C-j") 'doc-view-next-page
+ (kbd "C-k") 'doc-view-previous-page
+ "gj" 'doc-view-next-page
+ "gk" 'doc-view-previous-page
+ (kbd "C-d") 'forward-page
+ "j" 'doc-view-next-line-or-next-page
+ "k" 'doc-view-previous-line-or-previous-page
+ "gg" 'doc-view-first-page
+ "G" 'doc-view-last-page
+ "J" 'doc-view-goto-page
+ (kbd "RET") 'image-next-line
+
+ ;; zoom
+ "+" 'doc-view-enlarge
+ "=" 'doc-view-enlarge
+ "0" 'doc-view-scale-reset
+ "-" 'doc-view-shrink
+
+ "W" 'doc-view-fit-width-to-window ; Like evil-image.
+ "H" 'doc-view-fit-height-to-window ; Like evil-image.
+ "P" 'doc-view-fit-page-to-window
+ "X" 'doc-view-kill-proc
+
+ (kbd "s s") 'doc-view-set-slice
+ (kbd "s m") 'doc-view-set-slice-using-mouse
+ (kbd "s b") 'doc-view-set-slice-from-bounding-box
+ (kbd "s r") 'doc-view-reset-slice
+
+ (kbd "/") 'doc-view-search
+ (kbd "?") 'doc-view-search-backward
+ (kbd "C-t") 'doc-view-show-tooltip
+ (kbd "C-c C-c") 'doc-view-toggle-display
+ (kbd "C-c C-t") 'doc-view-open-text
+
+ ;; refresh
+ (kbd "gr") 'doc-view-revert-buffer)
+
+ ;; TODO: What if the user changes `evil-want-C-u-scroll' after this is run?
+ (when evil-want-C-u-scroll
+ (evil-collection-define-key 'normal 'doc-view-mode-map
+ (kbd "C-u") 'backward-page)))
+
+(provide 'evil-collection-doc-view)
+;;; evil-collection-doc-view.el ends here
diff --git a/modes/edebug/evil-collection-edebug.el b/modes/edebug/evil-collection-edebug.el
new file mode 100644
index 0000000..8d78bb2
--- /dev/null
+++ b/modes/edebug/evil-collection-edebug.el
@@ -0,0 +1,125 @@
+;;; evil-collection-edebug.el --- Evil bindings for Edebug -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, edebug, tools
+
+;; 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:
+;; Evil bindings for `edebug-mode'.
+
+;;; Code:
+(require 'edebug)
+(require 'evil-collection)
+
+(defconst evil-collection-edebug-maps
+ '(edebug-mode-map
+ edebug-x-instrumented-function-list-mode-map
+ edebug-x-breakpoint-list-mode-map))
+
+;;;###autoload
+(defun evil-collection-edebug-setup ()
+ "Set up `evil' bindings for `edebug'."
+ (evil-set-initial-state 'edebug-mode 'normal)
+
+ (add-hook 'edebug-mode-hook #'evil-normalize-keymaps)
+
+ (evil-collection-define-key nil 'edebug-mode-map
+ "g" nil
+ "G" nil)
+
+ ;; FIXME: Seems like other minor modes will readily clash with `edebug'.
+ ;; `lispyville' and `edebug' 's' key?
+ (evil-collection-define-key 'normal 'edebug-mode-map
+ ;; control
+ "s" 'edebug-step-mode
+ "n" 'edebug-next-mode
+ "go" 'edebug-go-mode
+ "gO" 'edebug-Go-nonstop-mode
+ "t" 'edebug-trace-mode
+ "T" 'edebug-Trace-fast-mode
+ "c" 'edebug-continue-mode
+ "C" 'edebug-Continue-fast-mode
+
+ "f" 'edebug-forward-sexp
+ "H" 'edebug-goto-here
+ "I" 'edebug-instrument-callee
+ "i" 'edebug-step-in
+ "o" 'edebug-step-out
+
+ ;; quit
+ "q" 'top-level
+ "Q" 'edebug-top-level-nonstop
+ "a" 'abort-recursive-edit
+ "S" 'edebug-stop
+
+ ;; breakpoints
+ "b" 'edebug-set-breakpoint
+ "u" 'edebug-unset-breakpoint
+ "B" 'edebug-next-breakpoint
+ "x" 'edebug-set-conditional-breakpoint
+ "X" 'edebug-set-global-break-condition
+
+ ;; evaluation
+ "r" 'edebug-previous-result
+ "e" 'edebug-eval-expression
+ (kbd "C-x C-e") 'edebug-eval-last-sexp
+ "EL" 'edebug-visit-eval-list
+
+ ;; views
+ "WW" 'edebug-where
+ "p" 'edebug-bounce-point
+ "P" 'edebug-view-outside ;; same as v
+ "WS" 'edebug-toggle-save-windows
+
+ ;; misc
+ "g?" 'edebug-help
+ "d" 'edebug-backtrace
+
+ "-" 'negative-argument
+
+ ;; statistics
+ "=" 'edebug-temp-display-freq-count
+
+ ;; GUD bindings
+ (kbd "C-c C-s") 'edebug-step-mode
+ (kbd "C-c C-n") 'edebug-next-mode
+ (kbd "C-c C-c") 'edebug-go-mode
+
+ (kbd "C-x SPC") 'edebug-set-breakpoint
+ (kbd "C-c C-d") 'edebug-unset-breakpoint
+ (kbd "C-c C-t") (lambda () (interactive) (edebug-set-breakpoint t))
+ (kbd "C-c C-l") 'edebug-where)
+
+ (with-eval-after-load 'edebug-x
+ (evil-collection-define-key 'normal 'edebug-x-instrumented-function-list-mode-map
+ "E" 'edebug-x-evaluate-function
+ "Q" 'edebug-x-clear-data
+ (kbd "RET") 'edebug-x-find-function
+ "q" 'quit-window)
+ (evil-collection-define-key 'normal 'edebug-x-breakpoint-list-mode-map
+ (kbd "RET") 'edebug-x-visit-breakpoint
+ "x" 'edebug-x-kill-breakpoint
+ "Q" 'edebug-x-clear-data
+ "q" 'quit-window)))
+
+(provide 'evil-collection-edebug)
+;;; evil-collection-edebug.el ends here
diff --git a/modes/ediff/evil-collection-ediff.el b/modes/ediff/evil-collection-ediff.el
new file mode 100644
index 0000000..48aa927
--- /dev/null
+++ b/modes/ediff/evil-collection-ediff.el
@@ -0,0 +1,205 @@
+;;; evil-collection-ediff.el --- Evil bindings for ediff -*- lexical-binding: t -*-
+;; Copyright (C) 2015 Justin Burkett
+
+;; Author: Justin Burkett <justin@burkett.cc>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Homepage: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1") (evil "1.2.3"))
+;; Keywords: evil, ediff, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Make ediff a little evil. This configures ediff to be friendlier to users
+;; of vim-like keybindings. Consult the help buffer (=?=) for more info.
+
+;; Here's a table describing the bindings
+
+;; | Command | Original Binding | Evil-ediff |
+;; |-----------------------------+------------------+-------------|
+;; | ediff-next-difference | n,SPC | C-j,n,SPC |
+;; | ediff-previous-difference | p,DEL | C-k,N,p,DEL |
+;; | ediff-jump-to-difference | j | d |
+;; | jump to first difference | 1j | gg (or 1d) |
+;; | jump to last difference | N/A | G |
+;; | copy region A to region B | a | a,l |
+;; | copy region B to region A | b | b,h |
+;; | scroll down 1 line | C-u 1 v | j |
+;; | scroll up 1 line | C-u 1 V | k |
+;; | scroll down half page | v,C-v | C-d,v,C-v |
+;; | scroll up half page | V,M-v | C-u,V,M-v |
+;; | scroll left | > | zh |
+;; | scroll right | < | zl |
+;; | toggle highlighting | h | H |
+;; | ediff-suspend | z | C-z |
+
+;; Not implemented yet
+;; | restore old diff | ra,rb,rc | u |
+
+;;; Code:
+
+(require 'evil-collection)
+(require 'ediff nil t)
+
+(defconst evil-collection-ediff-maps '(ediff-mode-map))
+
+(defvar evil-collection-ediff-initial-state-backup (evil-initial-state 'ediff-mode))
+(defvar evil-collection-ediff-long-help-message-compare2-backup ediff-long-help-message-compare2)
+(defvar evil-collection-ediff-long-help-message-compare3-backup ediff-long-help-message-compare3)
+(defvar evil-collection-ediff-long-help-message-narrow2-backup ediff-long-help-message-narrow2)
+(defvar evil-collection-ediff-long-help-message-word-backup ediff-long-help-message-word-mode)
+(defvar evil-collection-ediff-long-help-message-merge-backup ediff-long-help-message-merge)
+(defvar evil-collection-ediff-long-help-message-head-backup ediff-long-help-message-head)
+(defvar evil-collection-ediff-long-help-message-tail-backup ediff-long-help-message-tail)
+
+(defvar evil-collection-ediff-help-changed nil)
+
+(defun evil-collection-ediff-adjust-help ()
+ "Adjust long help messages to reflect evil-ediff bindings."
+ (unless evil-collection-ediff-help-changed
+ (dolist (msg '(ediff-long-help-message-compare2
+ ediff-long-help-message-compare3
+ ediff-long-help-message-narrow2
+ ediff-long-help-message-word-mode
+ ediff-long-help-message-merge
+ ediff-long-help-message-head
+ ediff-long-help-message-tail))
+ (dolist (chng '( ;;("^" . " ")
+ ("p,DEL -previous diff " . "k,N,p -previous diff ")
+ ("n,SPC -next diff " . " j,n -next diff ")
+ (" j -jump to diff " . " d -jump to diff ")
+ (" h -highlighting " . " H -highlighting ")
+ (" v/V -scroll up/dn " . "C-u/d -scroll up/dn ")
+ (" </> -scroll lt/rt " . "zh/zl -scroll lt/rt ")
+ (" z/q -suspend/quit" . "C-z/q -suspend/quit")))
+ (setf (symbol-value msg)
+ (replace-regexp-in-string (car chng) (cdr chng) (symbol-value msg))))))
+ (setq evil-collection-ediff-help-changed t))
+
+(defun evil-collection-ediff-scroll-left (&optional arg)
+ "Scroll left."
+ (interactive "P")
+ (let ((last-command-event ?>))
+ (ediff-scroll-horizontally arg)))
+
+(defun evil-collection-ediff-scroll-right (&optional arg)
+ "Scroll right."
+ (interactive "P")
+ (let ((last-command-event ?<))
+ (ediff-scroll-horizontally arg)))
+
+(defun evil-collection-ediff-scroll-up (&optional arg)
+ "Scroll up by half of a page."
+ (interactive "P")
+ (let ((last-command-event ?V))
+ (ediff-scroll-vertically arg)))
+
+(defun evil-collection-ediff-scroll-down (&optional arg)
+ "Scroll down by half of a page."
+ (interactive "P")
+ (let ((last-command-event ?v))
+ (ediff-scroll-vertically arg)))
+
+(defun evil-collection-ediff-scroll-down-1 ()
+ "Scroll down by a line."
+ (interactive)
+ (let ((last-command-event ?v))
+ (ediff-scroll-vertically 1)))
+
+(defun evil-collection-ediff-scroll-up-1 ()
+ "Scroll down by a line."
+ (interactive)
+ (let ((last-command-event ?V))
+ (ediff-scroll-vertically 1)))
+
+(defun evil-collection-ediff-first-difference ()
+ "Jump to first difference."
+ (interactive)
+ (ediff-jump-to-difference 1))
+
+(defun evil-collection-ediff-last-difference ()
+ "Jump to last difference."
+ (interactive)
+ (ediff-jump-to-difference ediff-number-of-differences))
+
+;; (defun evil-collection-ediff-restore-diff ()
+;; "Restore the copy of current region."
+;; (interactive)
+;; (ediff-restore-diff nil ?a)
+;; (ediff-restore-diff nil ?b))
+
+(defvar evil-collection-ediff-bindings
+ '(("d" . ediff-jump-to-difference)
+ ("H" . ediff-toggle-hilit)
+ ("\C-e" . evil-collection-ediff-scroll-down-1)
+ ("\C-y" . evil-collection-ediff-scroll-up-1)
+ ("j" . ediff-next-difference)
+ ("k" . ediff-previous-difference)
+ ("N" . ediff-previous-difference)
+ ("gg" . evil-collection-ediff-first-difference)
+ ("G" . evil-collection-ediff-last-difference)
+ ("\C-d" . evil-collection-ediff-scroll-down)
+ ("\C-u" . evil-collection-ediff-scroll-up)
+ ("\C-z" . ediff-suspend)
+ ("z" . nil)
+ ("zl" . evil-collection-ediff-scroll-right)
+ ("zh" . evil-collection-ediff-scroll-left)
+ ;; Not working yet
+ ;; ("u" . evil-collection-ediff-restore-diff)
+ )
+ "A list of bindings changed/added in evil-ediff.")
+
+(defun evil-collection-ediff-startup-hook ()
+ "Place evil-ediff bindings in `ediff-mode-map'."
+ (evil-make-overriding-map ediff-mode-map 'normal)
+ (dolist (entry evil-collection-ediff-bindings)
+ (define-key ediff-mode-map (car entry) (cdr entry)))
+ (unless (or ediff-3way-comparison-job
+ (eq ediff-split-window-function 'split-window-vertically))
+ (define-key ediff-mode-map "l" 'ediff-copy-A-to-B)
+ (define-key ediff-mode-map "h" 'ediff-copy-B-to-A))
+ (evil-normalize-keymaps)
+ nil)
+
+;;;###autoload
+(defun evil-collection-ediff-setup ()
+ "Initialize evil-ediff."
+ (interactive)
+ (evil-set-initial-state 'ediff-mode 'normal)
+ (add-hook 'ediff-keymap-setup-hook 'evil-collection-ediff-startup-hook)
+ (evil-collection-ediff-adjust-help))
+
+(defun evil-collection-ediff-revert ()
+ "Revert changes made by evil-ediff."
+ (interactive)
+ (evil-set-initial-state 'ediff-mode evil-collection-ediff-initial-state-backup)
+ (unless evil-collection-ediff-help-changed
+ (dolist (msg
+ '((ediff-long-help-message-compare2 . ediff-long-help-message-compare2-backup)
+ (ediff-long-help-message-compare3 . ediff-long-help-message-compare3-backup)
+ (ediff-long-help-message-narrow2 . ediff-long-help-message-narrow2-backup)
+ (ediff-long-help-message-word-mode . ediff-long-help-message-word-mode-backup)
+ (ediff-long-help-message-merge . ediff-long-help-message-merge-backup)
+ (ediff-long-help-message-head . ediff-long-help-message-head-backup)
+ (ediff-long-help-message-tail . ediff-long-help-message-tail-backup)))
+ (setf (symbol-value (car msg)) (symbol-value (cdr msg)))))
+ (setq evil-collection-ediff-help-changed nil)
+ (remove-hook 'ediff-keymap-setup-hook 'evil-collection-ediff-startup-hook))
+
+(provide 'evil-collection-ediff)
+;;; evil-collection-ediff.el ends here
diff --git a/modes/elfeed/evil-collection-elfeed.el b/modes/elfeed/evil-collection-elfeed.el
new file mode 100644
index 0000000..605e11a
--- /dev/null
+++ b/modes/elfeed/evil-collection-elfeed.el
@@ -0,0 +1,121 @@
+;;; evil-collection-elfeed.el --- Evil bindings for elfeed -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, elfeed, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for elfeed.
+
+;;; Code:
+(require 'elfeed nil t)
+(require 'evil-collection)
+
+(defvar elfeed-search-mode-map)
+(defvar elfeed-show-mode-map)
+
+(defconst evil-collection-elfeed-maps '(elfeed-search-mode-map
+ elfeed-show-mode-map))
+
+;;;###autoload
+(defun evil-collection-elfeed-setup ()
+ "Set up `evil' bindings for `elfeed'."
+
+ (evil-collection-inhibit-insert-state 'elfeed-search-mode-map)
+ (evil-set-initial-state 'elfeed-search-mode 'normal)
+ (evil-collection-define-key 'normal 'elfeed-search-mode-map
+ ;; open
+ (kbd "RET") 'elfeed-search-show-entry
+ (kbd "S-<return>") 'elfeed-search-browse-url
+ "go" 'elfeed-search-browse-url
+
+ "y" 'elfeed-search-yank
+
+ (kbd "SPC") 'scroll-up-command
+ (kbd "S-SPC") 'scroll-down-command
+
+ ;; filter
+ "s" 'elfeed-search-live-filter
+ "S" 'elfeed-search-set-filter
+
+ ;; refresh
+ "gR" 'elfeed-search-fetch ; TODO: Which update function is more useful?
+ "gr" 'elfeed-search-update--force
+
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'quit-window
+ "ZZ" 'quit-window)
+
+ (evil-collection-define-key '(normal visual) 'elfeed-search-mode-map
+ "+" 'elfeed-search-tag-all
+ "-" 'elfeed-search-untag-all
+ "U" 'elfeed-search-tag-all-unread
+ "u" 'elfeed-search-untag-all-unread)
+
+ (evil-collection-inhibit-insert-state 'elfeed-show-mode-map)
+ (evil-set-initial-state 'elfeed-show-mode 'normal)
+ (evil-collection-define-key 'normal 'elfeed-show-mode-map
+ (kbd "S-<return>") 'elfeed-show-visit
+ "go" 'elfeed-show-visit
+
+ (kbd "SPC") 'scroll-up-command
+ (kbd "S-SPC") 'scroll-down-command
+
+ ;; filter
+ "s" 'elfeed-show-new-live-search
+
+ "+" 'elfeed-show-tag
+ "-" 'elfeed-show-untag
+
+ "A" 'elfeed-show-add-enclosure-to-playlist
+ "P" 'elfeed-show-play-enclosure
+ "d" 'elfeed-show-save-enclosure
+
+ "]]" 'elfeed-show-next
+ "[[" 'elfeed-show-prev
+ "gj" 'elfeed-show-next
+ "gk" 'elfeed-show-prev
+ (kbd "C-j") 'elfeed-show-next
+ (kbd "C-k") 'elfeed-show-prev
+
+ ;; refresh
+ "gr" 'elfeed-show-refresh
+
+ ;; quit
+ "q" 'elfeed-kill-buffer
+ "ZQ" 'elfeed-kill-buffer
+ "ZZ" 'elfeed-kill-buffer)
+
+ (evil-collection-define-key 'operator 'elfeed-show-mode-map
+ ;; Like `eww'.
+ "u" '(menu-item
+ ""
+ nil
+ :filter (lambda (&optional _)
+ (when (memq evil-this-operator
+ evil-collection-yank-operators)
+ (setq evil-inhibit-operator t)
+ #'elfeed-show-yank)))))
+
+(provide 'evil-collection-elfeed)
+;;; evil-collection-elfeed.el ends here
diff --git a/modes/elisp-mode/evil-collection-elisp-mode.el b/modes/elisp-mode/evil-collection-elisp-mode.el
new file mode 100644
index 0000000..bb9909a
--- /dev/null
+++ b/modes/elisp-mode/evil-collection-elisp-mode.el
@@ -0,0 +1,79 @@
+;;; evil-collection-elisp-mode.el --- Bindings for `elisp-mode'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, elisp, lisp
+
+;; 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:
+;;; Bindings for `elisp-mode'.
+
+;;; Code:
+(require 'elisp-mode)
+(require 'evil-collection)
+
+(defconst evil-collection-elisp-mode-maps nil)
+
+(defun evil-collection-elisp-mode-last-sexp-setup-props (beg end value alt1 alt2)
+ "Set up text properties for the output of `elisp--eval-last-sexp'.
+BEG and END are the start and end of the output in current-buffer.
+VALUE is the Lisp value printed, ALT1 and ALT2 are strings for the
+alternative printed representations that can be displayed."
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "C-m") 'evil-collection-elisp-mode-return-or-last-sexp-toggle-display)
+ (define-key map [down-mouse-2] 'mouse-set-point)
+ (define-key map [mouse-2] 'elisp-last-sexp-toggle-display)
+ (add-text-properties
+ beg end
+ `(printed-value (,value ,alt1 ,alt2)
+ mouse-face highlight
+ keymap ,map
+ help-echo "RET, mouse-2: toggle abbreviated display"
+ rear-nonsticky (mouse-face keymap help-echo
+ printed-value)))))
+
+(defun evil-collection-elisp-mode-return-or-last-sexp-toggle-display ()
+ "Trigger RET or call `elisp-last-sexp-toggle-display'."
+ (interactive)
+ (if (eq evil-state 'insert)
+ (call-interactively
+ (lookup-key (current-global-map) (kbd "C-m")))
+ (call-interactively 'elisp-last-sexp-toggle-display)))
+
+(defun evil-collection-elisp-mode-last-sexp (command &rest args)
+ "In normal-state or motion-state, last sexp ends at point."
+ (if (and (not evil-move-beyond-eol)
+ (or (evil-normal-state-p) (evil-motion-state-p)))
+ (save-excursion
+ (unless (or (eobp) (eolp)) (forward-char))
+ (apply command args))
+ (apply command args)))
+
+;;;###autoload
+(defun evil-collection-elisp-mode-setup ()
+ "Set up `evil' bindings for `elisp-mode'."
+ (unless evil-move-beyond-eol
+ (advice-add 'eval-print-last-sexp :around 'evil-collection-elisp-mode-last-sexp))
+ (advice-add 'last-sexp-setup-props
+ :override 'evil-collection-elisp-mode-last-sexp-setup-props))
+
+(provide 'evil-collection-elisp-mode)
+;;; evil-collection-elisp-mode.el ends here
diff --git a/modes/elisp-refs/evil-collection-elisp-refs.el b/modes/elisp-refs/evil-collection-elisp-refs.el
new file mode 100644
index 0000000..6387c1d
--- /dev/null
+++ b/modes/elisp-refs/evil-collection-elisp-refs.el
@@ -0,0 +1,52 @@
+;;; evil-collection-elisp-refs.el --- Evil bindings for Elisp Refs -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, elisp-refs, tools
+
+;; 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:
+;; This package provides a sane set of defaults for `elisp-refs' when using
+;; `evil-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'elisp-refs nil t)
+
+(defconst evil-collection-elisp-refs-maps '(elisp-refs-mode-map))
+
+;;;###autoload
+(defun evil-collection-elisp-refs-setup ()
+ "Set up `evil' bindings for `elisp-refs'."
+ (evil-collection-define-key 'normal 'elisp-refs-mode-map
+ (kbd "<tab>") 'elisp-refs-next-match
+ (kbd "<backtab>") 'elisp-refs-prev-match
+ (kbd "C-j") 'elisp-refs-next-match
+ (kbd "C-k") 'elisp-refs-prev-match
+ "gj" 'elisp-refs-next-match
+ "gk" 'elisp-refs-prev-match
+ (kbd "RET") 'elisp-refs-visit-match
+
+ ;; quit
+ "q" 'kill-this-buffer))
+
+(provide 'evil-collection-elisp-refs)
+;;; evil-collection-elisp-refs.el ends here
diff --git a/modes/emms/evil-collection-emms.el b/modes/emms/evil-collection-emms.el
new file mode 100644
index 0000000..73bca97
--- /dev/null
+++ b/modes/emms/evil-collection-emms.el
@@ -0,0 +1,248 @@
+;;; evil-collection-emms.el --- Evil bindings for EMMS -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emms, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for EMMS.
+
+;;; Code:
+(require 'emms nil t)
+(require 'evil-collection)
+
+(declare-function emms-with-inhibit-read-only-t "emms")
+(declare-function emms-playlist-mode-correct-previous-yank "emms-playlist-mode")
+
+(defvar emms-browser-mode-map)
+(defvar emms-playlist-mode-map)
+
+(defconst evil-collection-emms-maps '(emms-browser-mode-map
+ emms-playlist-mode-map
+ emms-metaplaylist-mode-map
+ emms-stream-mode-map))
+
+(defun evil-collection-emms-playlist-mode-insert-newline-above ()
+ "Insert a newline above point."
+ (interactive)
+ (emms-with-inhibit-read-only-t
+ (evil-insert-newline-above)))
+
+(defun evil-collection-emms-playlist-mode-insert-newline-below ()
+ "Insert a newline below point."
+ (interactive)
+ (emms-with-inhibit-read-only-t
+ (evil-insert-newline-below)))
+
+(defun evil-collection-emms-playlist-mode-paste-before ()
+ "Pastes the latest yanked playlist items before the cursor position.
+The return value is the yanked text."
+ (interactive)
+ (emms-with-inhibit-read-only-t
+ (goto-char (point-at-bol))
+ (yank)
+ (emms-playlist-mode-correct-previous-yank)
+ (evil-previous-line)
+ (evil-beginning-of-line)))
+
+(defun evil-collection-emms-playlist-mode-paste-after ()
+ "Pastes the latest yanked playlist items behind point.
+The return value is the yanked text."
+ (interactive)
+ (unless (eobp) (evil-next-line))
+ (evil-collection-emms-playlist-mode-paste-before))
+
+;;;###autoload
+(defun evil-collection-emms-browser-setup ()
+ "Set up `evil' bindings for `emms-browser'."
+ ;; TODO: Why doesn't evil-set-initial-state work with emms-browser-mode?
+
+ (evil-collection-inhibit-insert-state 'emms-browser-mode-map)
+ (add-hook 'emms-browser-mode-hook 'evil-normal-state)
+ (evil-collection-define-key 'normal 'emms-browser-mode-map
+ ;; The following overrides other "g-" and "s-" prefixed keys so we set it first.
+ "g" nil
+ "g" (lookup-key emms-browser-mode-map (kbd "W"))
+ "s" nil
+ "s" (lookup-key emms-browser-mode-map (kbd "s"))
+
+ ;; playback controls
+ "x" 'emms-pause
+ "X" 'emms-stop
+ "r" 'emms-random
+ "<" 'emms-seek-backward
+ ">" 'emms-seek-forward
+ (kbd "RET") 'emms-browser-add-tracks
+ (kbd "C-<return>") 'emms-browser-add-tracks-and-play
+
+ ;; volume controls
+ "+" 'emms-volume-raise
+ "=" 'emms-volume-raise
+ "-" 'emms-volume-lower
+
+ "u" 'emms-playlist-mode-undo
+
+ ;; motion
+ "[[" 'emms-browser-prev-non-track
+ "]]" 'emms-browser-next-non-track
+ (kbd "C-k") 'emms-browser-prev-non-track
+ (kbd "C-j") 'emms-browser-next-non-track
+ "gk" 'emms-browser-prev-non-track
+ "gj" 'emms-browser-next-non-track
+
+ (kbd "<tab>") 'emms-browser-toggle-subitems-recursively
+ (kbd "<backtab>") 'emms-browser-toggle-subitems-recursively
+ "^" 'emms-browser-move-up-level
+ (kbd "SPC") 'emms-browser-toggle-subitems
+ "g1" 'emms-browser-collapse-all
+ "g2" 'emms-browser-expand-to-level-2
+ "g3" 'emms-browser-expand-to-level-3
+ "g4" 'emms-browser-expand-to-level-4
+ "g0" 'emms-browser-expand-all
+ "ga" 'emms-browse-by-artist
+ "gA" 'emms-browse-by-album
+ "gb" 'emms-browse-by-genre
+ "gy" 'emms-browse-by-year
+ "gc" 'emms-browse-by-composer
+ "gp" 'emms-browse-by-performer
+ "zm" 'emms-browser-collapse-all
+ "zr" 'emms-browser-expand-all
+ "zo" 'emms-browser-expand-one-level
+ ;; TODO find a real replacement for zc
+ "zc" 'emms-browser-collapse-all
+
+ ;; TODO find a way to integrate this with evil-collection-evil-search
+ "/" 'emms-isearch-buffer ; This shows hidden items during search.
+ "n" 'isearch-repeat-forward
+ "N" 'isearch-repeat-backward
+
+ ;; filter
+ ;; "" 'emms-browser-previous-filter ; TODO: What does this do?
+ ;; "" 'emms-browser-next-filter
+
+
+ "C" 'emms-browser-clear-playlist
+ "D" 'emms-browser-delete-files
+ "d" 'emms-browser-view-in-dired
+ "gd" 'emms-browser-view-in-dired)) ; "d" does the same, keep "gd" for consistency.
+
+;;;###autoload
+(defun evil-collection-emms-playlist-setup ()
+ "Set up `evil' bindings for `emms-playlist'."
+ (evil-set-initial-state 'emms-playlist-mode 'normal)
+ (evil-collection-define-key 'normal 'emms-playlist-mode-map
+ ;; playback controls
+ "x" 'emms-pause
+ "X" 'emms-stop
+ "r" 'emms-random
+ "<" 'emms-seek-backward
+ ">" 'emms-seek-forward
+ (kbd "C-j") 'emms-next
+ (kbd "C-k") 'emms-previous
+ "gj" 'emms-next
+ "gk" 'emms-previous
+ (kbd "RET") 'emms-playlist-mode-play-smart
+
+ ;; volume controls
+ "+" 'emms-volume-raise
+ "=" 'emms-volume-raise
+ "-" 'emms-volume-lower
+
+ "u" 'emms-playlist-mode-undo
+
+ ;; motion
+ "gg" 'emms-playlist-mode-first
+ "G" 'emms-playlist-mode-last
+ "]]" 'emms-playlist-mode-next
+ "[[" 'emms-playlist-mode-previous
+
+ "D" 'emms-playlist-mode-kill-track ; emms-browser uses "D"
+ "C" 'emms-playlist-clear
+ "O" 'evil-collection-emms-playlist-mode-insert-newline-above
+ "o" 'evil-collection-emms-playlist-mode-insert-newline-below
+ "P" 'evil-collection-emms-playlist-mode-paste-before
+ "p" 'evil-collection-emms-playlist-mode-paste-after
+
+ "u" 'emms-playlist-mode-undo
+
+ "ze" 'emms-tag-editor-edit
+ "R" 'emms-tag-editor-rename
+
+ "." 'emms-playlist-mode-center-current
+ "d" 'emms-playlist-mode-goto-dired-at-point
+ "gd" 'emms-playlist-mode-goto-dired-at-point ; "d" does the same, keep "gd" for consistency.
+
+ "zs" 'emms-show
+ "a" 'emms-playlist-mode-add-contents
+ "zp" 'emms-playlist-set-playlist-buffer
+
+ ;; filter
+ "S" (lookup-key emms-playlist-mode-map (kbd "S"))
+ "s" (lookup-key emms-playlist-mode-map (kbd "/"))
+ ;; "" 'emms-playlist-limit-to-all ; TODO: Test.
+
+ (kbd "M-y") 'emms-playlist-mode-yank-pop)
+
+ (evil-collection-define-key 'visual 'emms-playlist-mode-map
+ ;; "d" 'emms-playlist-mode-kill
+ "D" 'emms-playlist-mode-kill))
+
+;;;###autoload
+(defun evil-collection-emms-setup ()
+ "Set up `evil' bindings for `emms'."
+ ;; emms-browser and emms-playlist-mode must be set up after they are loaded
+ ;; because we need the mode map to be defined when we `(lookup-key
+ ;; ...-mode-map ...)'.
+ (with-eval-after-load 'emms-browser
+ (evil-collection-emms-browser-setup))
+ (with-eval-after-load 'emms-playlist-mode
+ (evil-collection-emms-playlist-setup))
+
+ (evil-collection-define-key 'normal 'emms-browser-search-mode-map
+ "q" 'emms-browser-kill-search)
+
+ (evil-set-initial-state 'emms-metaplaylist-mode 'normal)
+ (evil-collection-define-key 'normal 'emms-metaplaylist-mode-map
+ (kbd "RET") 'emms-metaplaylist-mode-goto-current
+ (kbd "<space>") 'emms-metaplaylist-mode-set-active
+ "gr" 'emms-metaplaylist-mode-update
+ "C" 'emms-metaplaylist-mode-new-buffer
+ "." 'emms-metaplaylist-mode-center-current
+ "D" 'emms-metaplaylist-mode-kill-buffer
+ "q" 'kill-this-buffer)
+
+ (evil-set-initial-state 'emms-stream-mode 'normal)
+ (evil-collection-define-key 'normal 'emms-stream-mode-map
+ (kbd "RET") 'emms-stream-play
+ "j" 'emms-stream-next-line
+ "k" 'emms-stream-previous-line
+ "y" 'emms-stream-yank-bookmark
+ "d" 'emms-stream-kill-bookmark
+ "c" 'emms-stream-edit-bookmark
+ "r" 'emms-stream-edit-bookmark
+ "i" 'emms-stream-info-bookmark
+ "s" 'emms-stream-save-bookmarks-file
+ "x" 'emms-stream-toggle-default-action
+ "q" 'emms-stream-quit))
+
+(provide 'evil-collection-emms)
+;;; evil-collection-emms.el ends here
diff --git a/modes/epa/evil-collection-epa.el b/modes/epa/evil-collection-epa.el
new file mode 100644
index 0000000..f6f2958
--- /dev/null
+++ b/modes/epa/evil-collection-epa.el
@@ -0,0 +1,71 @@
+;;; evil-collection-epa.el --- Evil bindings for epa-mode -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: Maximiliano Sandoval <msandova@protonmail.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, epa, tools
+
+;; 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:
+;; Evil bindings for `epa-mode'.
+
+;;; Code:
+
+(require 'evil-collection)
+(require 'epa nil t)
+
+(defconst evil-collection-epa-maps '(epa-key-list-mode-map
+ epa-key-mode-map
+ epa-info-mode-map))
+
+;;;###autoload
+(defun evil-collection-epa-setup ()
+ (evil-collection-define-key 'normal 'epa-key-list-mode-map
+ (kbd "<tab>") 'widget-forward
+ "gr" 'revert-buffer
+ "q" 'epa-exit-buffer
+ "E" 'epa-decrypt-file
+ "d" 'epa-delete-keys
+ "ZZ" 'quit-window
+ "ZQ" 'evil-quit
+ "V" 'epa-verify-file
+
+ ;; mark
+ "m" 'epa-mark-key
+ "u" 'epa-unmark-key
+
+ ;; Unchanged keybindings.
+ "s" 'epa-sign-file
+ "e" 'epa-encrypt-file
+ "i" 'epa-import-keys
+ "o" 'epa-export-keys)
+
+ (evil-collection-define-key 'normal 'epa-key-mode-map
+ "q" 'epa-exit-buffer
+ "ZZ" 'quit-window
+ "ZQ" 'evil-quit)
+
+ (evil-collection-define-key 'normal 'epa-info-mode-map
+ "q" 'delete-window
+ "ZZ" 'quit-window
+ "ZQ" 'evil-quit))
+
+(provide 'evil-collection-epa)
+;;; evil-collection-epa.el ends here
diff --git a/modes/ert/evil-collection-ert.el b/modes/ert/evil-collection-ert.el
new file mode 100644
index 0000000..9b4ca06
--- /dev/null
+++ b/modes/ert/evil-collection-ert.el
@@ -0,0 +1,71 @@
+;;; evil-collection-ert.el --- Bindings for `ert' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2018 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;; Bindings for `ert'.
+
+;;; Code:
+(require 'ert)
+(require 'evil-collection)
+
+(defconst evil-collection-ert-maps '(ert-results-mode-map))
+
+;;;###autoload
+(defun evil-collection-ert-setup ()
+ "Set up `evil' bindings for `ert'."
+ (evil-collection-inhibit-insert-state 'ert-results-mode-map)
+ (evil-set-initial-state 'ert-results-mode 'normal)
+
+ (evil-collection-define-key 'normal 'ert-results-mode-map
+ "j" 'evil-next-line
+ "k" 'evil-previous-line
+ "h" 'evil-backward-char
+ "l" 'evil-forward-char
+ ;; Stuff that's not in the menu.
+ "J" 'ert-results-jump-between-summary-and-result
+ "L" 'ert-results-toggle-printer-limits-for-test-at-point
+ "gj" 'ert-results-next-test
+ "gk" 'ert-results-previous-test
+ "]]" 'ert-results-next-test
+ "[[" 'ert-results-previous-test
+ (kbd "C-j") 'ert-results-next-test
+ (kbd "C-k") 'ert-results-previous-test
+ ;; Stuff that is in the menu.
+ "gr" 'ert-results-rerun-all-tests
+ "R" 'ert-results-rerun-all-tests
+ "r" 'ert-results-rerun-test-at-point
+ "d" 'ert-results-rerun-test-at-point-debugging-errors
+ "." 'ert-results-find-test-at-point-other-window
+ "gd" 'ert-results-find-test-at-point-other-window
+ "B" 'ert-results-pop-to-backtrace-for-test-at-point
+ "M" 'ert-results-pop-to-messages-for-test-at-point
+ "s" 'ert-results-pop-to-should-forms-for-test-at-point
+ "K" 'ert-results-describe-test-at-point
+ "g?" 'ert-results-describe-test-at-point
+ "x" 'ert-delete-test
+ "T" 'ert-results-pop-to-timings))
+
+(provide 'evil-collection-ert)
+;;; evil-collection-ert.el ends here
diff --git a/modes/eshell/evil-collection-eshell.el b/modes/eshell/evil-collection-eshell.el
new file mode 100644
index 0000000..94918da
--- /dev/null
+++ b/modes/eshell/evil-collection-eshell.el
@@ -0,0 +1,100 @@
+;;; evil-collection-eshell.el --- Evil bindings for Eshell -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, eshell, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for Eshell.
+
+;;; Code:
+(require 'em-prompt)
+(require 'eshell)
+(require 'evil-collection)
+
+(defconst evil-collection-eshell-maps '(eshell-mode-map))
+
+(defun evil-collection-eshell-next-prompt ()
+ "`evil' wrapper around `eshell-next-prompt'."
+ (when (get-text-property (point) 'read-only)
+ ;; If at end of prompt, `eshell-next-prompt' will not move, so go backward.
+ (beginning-of-line)
+ (eshell-next-prompt 1)))
+
+(defun evil-collection-eshell-next-prompt-on-insert ()
+ "Go to next prompt on `evil' replace/insert enter."
+ (dolist (hook '(evil-replace-state-entry-hook evil-insert-state-entry-hook))
+ (add-hook hook 'evil-collection-eshell-next-prompt nil t)))
+
+(defun evil-collection-eshell-interrupt-process ()
+ "Interupt `eshell' process and enter insert state."
+ (interactive)
+ (eshell-interrupt-process)
+ (evil-insert 1))
+
+;;; `eshell-mode-map' is reset when Eshell is initialized in `eshell-mode'. We
+;;; need to add bindings to `eshell-first-time-mode-hook'.
+(defun evil-collection-eshell-setup-keys ()
+ "Set up `evil' bindings for `eshell'."
+ (evil-collection-define-key 'normal 'eshell-mode-map
+ ;; motion
+ "[[" 'eshell-previous-prompt
+ "]]" 'eshell-next-prompt
+ (kbd "C-k") 'eshell-previous-prompt
+ (kbd "C-j") 'eshell-next-prompt
+ "gk" 'eshell-previous-prompt
+ "gj" 'eshell-next-prompt
+ "0" 'eshell-bol
+ "^" 'eshell-bol
+ (kbd "M-h") 'eshell-backward-argument
+ (kbd "M-l") 'eshell-forward-argument
+
+ (kbd "C-n") 'eshell-next-matching-input-from-input
+ (kbd "C-p") 'eshell-previous-matching-input-from-input
+
+ (kbd "RET") 'eshell-send-input
+ (kbd "C-c C-c") 'evil-collection-eshell-interrupt-process)
+ (evil-collection-define-key 'insert 'eshell-mode-map
+ ;; motion
+ (kbd "M-h") 'eshell-backward-argument
+ (kbd "M-l") 'eshell-forward-argument)
+ (evil-collection-define-key 'visual 'eshell-mode-map
+ ;; motion
+ ;; TODO: This does not work with `evil-visual-line'.
+ "[[" 'eshell-previous-prompt
+ "]]" 'eshell-next-prompt
+ (kbd "C-k") 'eshell-previous-prompt
+ (kbd "C-j") 'eshell-next-prompt
+ "gk" 'eshell-previous-prompt
+ "gj" 'eshell-next-prompt
+ "0" 'eshell-bol
+ "^" 'eshell-bol))
+
+;; TODO: Compare this setup procedure with evil-ediff.
+;;;###autoload
+(defun evil-collection-eshell-setup ()
+ "Set up `evil' bindings for `eshell'."
+ (add-hook 'eshell-mode-hook 'evil-collection-eshell-next-prompt-on-insert)
+ (add-hook 'eshell-first-time-mode-hook 'evil-collection-eshell-setup-keys))
+
+(provide 'evil-collection-eshell)
+;;; evil-collection-eshell.el ends here
diff --git a/modes/eval-sexp-fu/evil-collection-eval-sexp-fu.el b/modes/eval-sexp-fu/evil-collection-eval-sexp-fu.el
new file mode 100644
index 0000000..1a42bca
--- /dev/null
+++ b/modes/eval-sexp-fu/evil-collection-eval-sexp-fu.el
@@ -0,0 +1,61 @@
+;;; evil-collection-eval-sexp-fu.el --- Bindings for `eval-sexp-fu'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, eval-sexp-fu, tools
+
+;; 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:
+;;; Bindings for `eval-sexp-fu'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'eval-sexp-fu nil t)
+
+(defconst evil-collection-eval-sexp-fu-maps nil)
+
+(defun evil-collection-eval-sexp-fu-bounds-of-thing-at-point-sexp (command &rest args)
+ "In normal-state or motion-state, last sexp ends at point."
+ (if (and (eq (nth 0 args) 'sexp)
+ (and (not evil-move-beyond-eol)
+ (or (evil-normal-state-p) (evil-motion-state-p))))
+ (save-excursion
+ (unless (or (eobp) (eolp)) (forward-char))
+ (apply command args))
+ (apply command args)))
+
+(defun evil-collection-eval-sexp-fu-advise-bounds-of-thing-at-point (command &rest args)
+ "Advise `bounds-of-thing-at-point' to handle `evil's `evil-move-beyond-eol'."
+ (advice-add 'bounds-of-thing-at-point
+ :around 'evil-collection-eval-sexp-fu-bounds-of-thing-at-point-sexp)
+ (apply command args)
+ (advice-remove 'bounds-of-thing-at-point
+ 'evil-collection-eval-sexp-fu-bounds-of-thing-at-point-sexp))
+
+;;;###autoload
+(defun evil-collection-eval-sexp-fu-setup ()
+ "Set up `evil' with `eval-sexp-fu'."
+ (unless evil-move-beyond-eol
+ (advice-add 'ad-Advice-eval-last-sexp
+ :around 'evil-collection-eval-sexp-fu-advise-bounds-of-thing-at-point)))
+
+(provide 'evil-collection-eval-sexp-fu)
+;;; evil-collection-eval-sexp-fu.el ends here
diff --git a/modes/eww/evil-collection-eww.el b/modes/eww/evil-collection-eww.el
new file mode 100644
index 0000000..8f3ae0e
--- /dev/null
+++ b/modes/eww/evil-collection-eww.el
@@ -0,0 +1,153 @@
+;;; evil-collection-eww.el --- Evil bindings for EWW -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, eww, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for EWW.
+
+;;; Code:
+(require 'eww)
+(require 'evil-collection)
+
+(defvar evil-collection-eww-maps '(eww-mode-map
+ eww-history-mode-map
+ eww-buffers-mode-map
+ eww-bookmark-mode-map))
+
+;;;###autoload
+(defun evil-collection-eww-setup ()
+ "Set up `evil' bindings for `eww'."
+
+ (evil-collection-define-key 'normal 'eww-mode-map
+ "^" 'eww-up-url
+ "u" 'eww-up-url
+ "U" 'eww-top-url
+ (kbd "<backspace>") 'eww-back-url
+ "H" 'eww-back-url
+ "L" 'eww-forward-url
+
+ "gf" 'eww-view-source ; Like qutebrowser.
+
+ "&" 'eww-browse-with-external-browser
+ "gc" 'url-cookie-list
+ "zd" 'eww-toggle-paragraph-direction
+ "ze" 'eww-set-character-encoding
+ "zf" 'eww-toggle-fonts
+ "d" 'eww-download
+ "m" 'eww-add-bookmark
+ "R" 'eww-readable ; Default binding.
+ "r" 'eww-readable
+
+ "]]" 'eww-next-url
+ "[[" 'eww-previous-url
+ "gj" 'eww-next-url
+ "gk" 'eww-previous-url
+
+ ;; open
+ (kbd "S-<return>") 'eww-browse-with-external-browser
+ "go" 'eww-browse-with-external-browser
+ "o" 'eww ; Like qutebrowser.
+
+ (kbd "SPC") 'scroll-up-command
+ (kbd "S-SPC") 'scroll-down-command
+ (kbd "<tab>") 'shr-next-link
+ (kbd "<backtab>") 'shr-previous-link
+
+ ;; bookmarks
+ "gb" 'eww-list-bookmarks
+
+ "gh" 'eww-list-histories
+ "gt" 'eww-list-buffers ; Like dwb, qutebrowser.
+
+ ;; refresh
+ "gr" 'eww-reload
+
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'quit-window
+ "ZZ" 'quit-window)
+
+ (evil-collection-define-key 'operator 'eww-mode-map
+ "u" '(menu-item
+ ""
+ nil
+ :filter (lambda (&optional _)
+ (when (memq evil-this-operator
+ evil-collection-yank-operators)
+ (setq evil-inhibit-operator t)
+ #'eww-copy-page-url))))
+
+ (evil-collection-inhibit-insert-state 'eww-history-mode-map)
+ (evil-set-initial-state 'eww-history-mode 'normal)
+ (evil-collection-define-key 'normal 'eww-history-mode-map
+ (kbd "RET") 'eww-history-browse
+ ;; refresh
+ "gr" 'revert-buffer
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'quit-window
+ "ZZ" 'quit-window)
+
+ (evil-collection-inhibit-insert-state 'eww-buffers-mode-map)
+ (evil-set-initial-state 'eww-buffers-mode 'normal)
+ (evil-collection-define-key 'normal 'eww-buffers-mode-map
+ "D" 'eww-buffer-kill
+ (kbd "RET") 'eww-buffer-select
+ "]]" 'eww-buffer-show-next
+ "[[" 'eww-buffer-show-previous
+ "gj" 'eww-buffer-show-next
+ "gk" 'eww-buffer-show-previous
+ ;; refresh
+ "gr" 'revert-buffer
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'quit-window
+ "ZZ" 'quit-window)
+
+ (evil-collection-inhibit-insert-state 'eww-bookmark-mode-map)
+ (evil-set-initial-state 'eww-bookmark-mode 'normal)
+ (evil-collection-define-key 'normal 'eww-bookmark-mode-map
+ "D" 'eww-bookmark-kill
+ "P" 'eww-bookmark-yank
+
+ (kbd "RET") 'eww-bookmark-browse
+ ;; refresh
+ "gr" 'revert-buffer
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'quit-window
+ "ZZ" 'quit-window)
+
+ (evil-collection-define-key 'operator 'eww-bookmark-mode-map
+ "u" '(menu-item
+ ""
+ nil
+ :filter (lambda (&optional _)
+ (when (memq evil-this-operator
+ evil-collection-yank-operators)
+ (setq evil-inhibit-operator t)
+ #'eww-copy-page-url)))))
+
+(provide 'evil-collection-eww)
+;;; evil-collection-eww.el ends here
diff --git a/modes/flycheck/evil-collection-flycheck.el b/modes/flycheck/evil-collection-flycheck.el
new file mode 100644
index 0000000..afcab4c
--- /dev/null
+++ b/modes/flycheck/evil-collection-flycheck.el
@@ -0,0 +1,56 @@
+;;; evil-collection-flycheck.el --- Evil bindings for flycheck -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, flycheck, tools
+
+;; 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:
+;; Evil bindings for `flycheck-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'flycheck nil t)
+
+(defvar flycheck-error-list-mode-map)
+
+(defconst evil-collection-flycheck-maps '(flycheck-error-list-mode-map))
+
+;;;###autoload
+(defun evil-collection-flycheck-setup ()
+ "Set up `evil' bindings for `flycheck'."
+ (evil-set-initial-state 'flycheck-error-list-mode 'normal)
+ (evil-collection-define-key 'normal 'flycheck-error-list-mode-map
+ "gj" 'flycheck-error-list-next-error
+ "gk" 'flycheck-error-list-previous-error
+ (kbd "C-j") 'flycheck-error-list-next-error
+ (kbd "C-k") 'flycheck-error-list-previous-error
+ "]]" 'flycheck-error-list-next-error
+ "[[" 'flycheck-error-list-previous-error
+ "gr" 'flycheck-error-list-check-source
+ "s" 'flycheck-error-list-set-filter
+ "S" 'flycheck-error-list-reset-filter
+ "x" 'flycheck-error-list-explain-error
+ (kbd "RET") 'flycheck-error-list-goto-error
+ "q" 'quit-window))
+
+(provide 'evil-collection-flycheck)
+;;; evil-collection-flycheck.el ends here
diff --git a/modes/free-keys/evil-collection-free-keys.el b/modes/free-keys/evil-collection-free-keys.el
new file mode 100644
index 0000000..da8ba20
--- /dev/null
+++ b/modes/free-keys/evil-collection-free-keys.el
@@ -0,0 +1,53 @@
+;;; evil-collection-free-keys.el --- Bindings for `free-keys' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;;; Bindings for `free-keys'.
+(require 'evil-collection)
+(require 'free-keys nil t)
+
+;;; Code:
+(defvar free-keys-mode-map)
+
+(defconst evil-collection-free-keys-maps '(free-keys-mode-map))
+
+(defun evil-collection-free-keys-set-header-line-format ()
+ "Tweak `header-line-format' locally for `free-keys'."
+ (setq-local header-line-format
+ "Help: (c) change buffer (p) change prefix (q) quit"))
+
+;;;###autoload
+(defun evil-collection-free-keys-setup ()
+ "Set up `evil' bindings for `free-keys'."
+ (add-hook 'free-keys-mode-hook
+ #'evil-collection-free-keys-set-header-line-format)
+ (evil-set-initial-state 'free-keys-mode 'normal)
+ (evil-collection-define-key 'normal 'free-keys-mode-map
+ "c" 'free-keys-change-buffer
+ "p" 'free-keys-set-prefix
+ "q" 'quit-window))
+
+(provide 'evil-collection-free-keys)
+;;; evil-collection-free-keys.el ends here
diff --git a/modes/geiser/evil-collection-geiser.el b/modes/geiser/evil-collection-geiser.el
new file mode 100644
index 0000000..0ee4bee
--- /dev/null
+++ b/modes/geiser/evil-collection-geiser.el
@@ -0,0 +1,104 @@
+;;; evil-collection-geiser.el --- Bindings for `geiser'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, geiser, tools
+
+;; 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:
+;;; Bindings for `geiser'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'geiser nil t)
+
+(defvar geiser-debug-mode-map)
+(defvar geiser-doc-mode-map)
+
+(defconst evil-collection-geiser-maps '(geiser-debug-mode-map
+ geiser-doc-mode-map
+ geiser-repl-mode-map
+ geiser-mode-map))
+
+(defun evil-collection-geiser-last-sexp (command &rest args)
+ "In normal-state or motion-state, last sexp ends at point."
+ (if (and (not evil-move-beyond-eol)
+ (or (evil-normal-state-p) (evil-motion-state-p)))
+ (save-excursion
+ (unless (or (eobp) (eolp)) (forward-char))
+ (apply command args))
+ (apply command args)))
+
+;;;###autoload
+(defun evil-collection-geiser-setup ()
+ "Set up bindings for `geiser'."
+ (unless evil-move-beyond-eol
+ (advice-add 'geiser-eval-last-sexp :around 'evil-collection-geiser-last-sexp)
+ (advice-add 'geiser-eval-last-sexp-and-print :around 'evil-collection-geiser-last-sexp))
+
+ (evil-set-initial-state 'geiser-debug-mode 'normal)
+ (evil-set-initial-state 'geiser-doc-mode 'normal)
+
+ (evil-collection-define-key 'normal 'geiser-debug-mode-map
+ "q" 'quit-window)
+
+ (evil-collection-define-key 'normal 'geiser-doc-mode-map
+ (kbd "<tab>") 'forward-button
+ (kbd "<S-tab>") 'backward-button
+ "gd" 'geiser-edit-symbol-at-point
+ (kbd "C-t") 'geiser-pop-symbol-stack
+ "gr" 'geiser-doc-refresh
+ "q" 'View-quit
+ "gz" 'geiser-doc-switch-to-repl
+ ">" 'geiser-doc-next
+ "<" 'geiser-doc-previous
+ "gj" 'forward-button
+ "gk" 'backward-button
+ (kbd "C-j") 'forward-button
+ (kbd "C-k") 'backward-button
+ "]]" 'geiser-doc-next-section
+ "[[" 'geiser-doc-previous-section
+ "x" 'geiser-doc-kill-page
+ "X" 'geiser-doc-clean-history)
+
+ (evil-collection-define-key 'insert 'geiser-repl-mode-map
+ (kbd "S-<return>") 'geiser-repl--newline-and-indent)
+
+ (evil-collection-define-key 'normal 'geiser-repl-mode-map
+ "gd" 'geiser-edit-symbol-at-point
+ (kbd "C-t") 'geiser-pop-symbol-stack
+ "gj" 'geiser-repl-next-prompt
+ "gk" 'geiser-repl-previous-prompt
+ (kbd "C-j") 'geiser-repl-next-prompt
+ (kbd "C-k") 'geiser-repl-previous-prompt
+ "]]" 'geiser-repl-next-prompt
+ "[[" 'geiser-repl-previous-prompt
+ "K" 'geiser-doc-symbol-at-point)
+
+ (evil-collection-define-key 'normal 'geiser-mode-map
+ "gd" 'geiser-edit-symbol-at-point
+ (kbd "C-t") 'geiser-pop-symbol-stack
+ "gZ" 'geiser-mode-switch-to-repl-and-enter
+ "gz" 'geiser-mode-switch-to-repl
+ "K" 'geiser-doc-symbol-at-point))
+
+(provide 'evil-collection-geiser)
+;;; evil-collection-geiser.el ends here
diff --git a/modes/ggtags/evil-collection-ggtags.el b/modes/ggtags/evil-collection-ggtags.el
new file mode 100644
index 0000000..fd95bca
--- /dev/null
+++ b/modes/ggtags/evil-collection-ggtags.el
@@ -0,0 +1,100 @@
+;;; evil-collection-ggtags.el --- Evil bindings for ggtags -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, ggtags, tools
+
+;; 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:
+;; Evil bindings for `ggtags-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'ggtags nil t)
+
+(defvar ggtags-global-mode-map)
+(defvar ggtags-mode-map)
+(defvar ggtags-view-search-history-mode-map)
+(defvar ggtags-view-tag-history-mode-map)
+(defvar ggtags-navigation-map)
+
+(defconst evil-collection-ggtags-maps '(ggtags-mode-map
+ ggtags-view-search-history-mode-map
+ ggtags-view-tag-history-mode-map
+ ggtags-navigation-map))
+
+;;;###autoload
+(defun evil-collection-ggtags-setup ()
+ "Set up `evil' bindings for `ggtags'."
+ (evil-set-initial-state 'ggtags-global-mode 'normal)
+ (evil-set-initial-state 'ggtags-view-search-history-mode 'normal)
+ (evil-set-initial-state 'ggtags-view-tag-history-mode 'normal)
+
+ ;; `ggtags-navigation-mode' is global and will conflict with other bindings.
+ ;; https://github.com/leoliu/ggtags/issues/124
+ (when (boundp 'ggtags-enable-navigation-keys)
+ (setq ggtags-enable-navigation-keys nil))
+
+ (evil-collection-define-key 'normal 'ggtags-mode-map
+ "gd" 'ggtags-find-tag-dwim
+ (kbd "C-t") 'ggtags-prev-mark
+ "gf" 'ggtags-find-file)
+
+ (evil-collection-define-key 'normal 'ggtags-view-search-history-mode-map
+ "gj" 'ggtags-view-search-history-next
+ "gk" 'ggtags-view-search-history-prev
+ (kbd "C-j") 'ggtags-view-search-history-next
+ (kbd "C-k") 'ggtags-view-search-history-prev
+ "]]" 'ggtags-view-search-history-next
+ "[[" 'ggtags-view-search-history-prev
+ "x" 'ggtags-view-search-history-kill
+ "gr" 'ggtags-view-search-history-update
+ "r" 'ggtags-save-to-register
+ "R" 'ggtags-view-search-history-action
+ "q" 'ggtags-kill-window)
+
+ (evil-collection-define-key 'normal 'ggtags-view-tag-history-mode-map
+ "gj" 'next-error-no-select
+ (kbd "C-j") 'next-error-no-select
+ "]]" 'next-error-no-select
+ "gk" 'previous-error-no-select
+ (kbd "C-k") 'previous-error-no-select
+ (kbd "[[") 'previous-error-no-select
+ "q" 'ggtags-kill-window)
+
+ (evil-collection-define-key 'normal 'ggtags-navigation-map
+ ;; navigation
+ "gj" 'next-error
+ "gk" 'next-error
+ (kbd "C-j") 'previous-error
+ (kbd "C-k") 'previous-error
+ "]]" 'ggtags-navigation-next-file
+ "[[" 'ggtags-navigation-previous-file
+
+ ;; search
+ "s" 'ggtags-navigation-isearch-forward
+ "S" 'ggtags-navigation-isearch-forward
+
+ "go" 'ggtags-navigation-visible-mode ;; FIXME: This can be anything.
+ (kbd "RET") 'ggtags-navigation-mode-done))
+
+(provide 'evil-collection-ggtags)
+;;; evil-collection-ggtags.el ends here
diff --git a/modes/git-timemachine/evil-collection-git-timemachine.el b/modes/git-timemachine/evil-collection-git-timemachine.el
new file mode 100644
index 0000000..a4507cb
--- /dev/null
+++ b/modes/git-timemachine/evil-collection-git-timemachine.el
@@ -0,0 +1,49 @@
+;;; evil-collection-git-timemachine.el --- Bindings for `git-timemachine' -*- lexical-binding: t -*-
+
+;; Author: William Carroll <wpcarro@gmail.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, git, tools
+
+;; 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:
+;; Evil keybindings for `git-timemachine' that conform to the principles
+;; outlines in evil-collection
+
+;;; Code:
+(require 'evil-collection)
+(require 'git-timemachine nil t)
+
+(defvar git-timemachine-mode-map)
+(defconst evil-collection-git-timemachine-map '(git-timemachine-mode-map))
+
+;;;###autoload
+(defun evil-collection-git-timemachine-setup ()
+ "Setup `evil' keybindings for `git-timemachine'."
+ (evil-define-minor-mode-key 'normal 'git-timemachine-mode
+ "\C-k" 'git-timemachine-show-previous-revision
+ "\C-j" 'git-timemachine-show-next-revision
+ "q" 'git-timemachine-quit
+ "gtg" 'git-timemachine-show-nth-revision
+ "gtt" 'git-timemachine-show-revision-fuzzy
+ "gty" 'git-timemachine-kill-abbreviated-revision
+ "gtY" 'git-timemachine-kill-revision
+ "gtb" 'git-timemachine-blame))
+
+(provide 'evil-collection-git-timemachine)
+;;; evil-collection-git-timemachine.el ends here
diff --git a/modes/go-mode/evil-collection-go-mode.el b/modes/go-mode/evil-collection-go-mode.el
new file mode 100644
index 0000000..09930d7
--- /dev/null
+++ b/modes/go-mode/evil-collection-go-mode.el
@@ -0,0 +1,47 @@
+;;; evil-collection-go-mode.el --- Bindings for `go-mode'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools, golang
+
+;; 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:
+;; Bindings for `go-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'go-mode nil t)
+
+(defconst evil-collection-go-mode-maps '(go-mode-map
+ godoc-mode-map))
+
+;;;###autoload
+(defun evil-collection-go-mode-setup ()
+ "Set up `evil' bindings for `go-mode'."
+ (evil-collection-define-key 'normal 'go-mode-map
+ "gd" 'godef-jump
+ "K" 'godef-describe)
+ (evil-collection-define-key 'normal 'godoc-mode-map
+ "q" 'quit-window
+ "g?" 'describe-mode))
+
+(provide 'evil-collection-go-mode)
+;;; evil-collection-go-mode.el ends here
diff --git a/modes/grep/evil-collection-grep.el b/modes/grep/evil-collection-grep.el
new file mode 100644
index 0000000..93a6b73
--- /dev/null
+++ b/modes/grep/evil-collection-grep.el
@@ -0,0 +1,45 @@
+;;; evil-collection-grep.el --- Bindings for `grep' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2018 James Nguyen
+
+;; Author: Fredrik Bergroth <fbergroth@gmail.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;; Bindings for `grep'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'grep)
+
+(defconst evil-collection-grep-maps '(grep-mode-map))
+
+;;;###autoload
+(defun evil-collection-grep-setup ()
+ "Set up `evil' bindings for `grep'."
+ (evil-collection-define-key 'normal 'grep-mode-map
+ "n" 'evil-search-next
+ "\C-j" 'next-error-no-select
+ "\C-k" 'previous-error-no-select))
+
+
+(provide 'evil-collection-grep)
+;;; evil-collection-grep.el ends here
diff --git a/modes/guix/evil-collection-guix.el b/modes/guix/evil-collection-guix.el
new file mode 100644
index 0000000..f364406
--- /dev/null
+++ b/modes/guix/evil-collection-guix.el
@@ -0,0 +1,227 @@
+;;; evil-collection-guix.el --- Evil bindings for Guix -*- lexical-binding: t -*-
+
+;; Copyright (C) 2018 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, guix, tools
+
+;; 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:
+;; Evil bindings for `guix'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'guix nil t)
+
+(defconst evil-collection-guix-maps '(guix-output-list-mode-map
+ guix-package-info-mode-map
+ guix-profile-list-mode-map
+ guix-profile-info-mode-map
+ guix-generation-list-mode-map
+ guix-generation-info-mode-map
+ guix-license-list-mode-map
+ guix-license-info-mode-map
+ guix-location-list-mode-map
+ guix-hydra-build-list-mode-map
+ guix-hydra-build-info-mode-map
+ guix-build-log-mode-map
+ guix-service-list-mode-map))
+
+(defmacro evil-collection-guix-set (map)
+ "Set common bindings in MAP."
+ `(progn
+ (evil-collection-inhibit-insert-state ',map)
+ (evil-collection-define-key 'normal ',map
+ ;; motion
+ (kbd "SPC") 'scroll-up-command
+ (kbd "S-SPC") 'scroll-down-command
+ (kbd "<tab>") 'forward-button
+ (kbd "<backtab>") 'backward-button
+
+ "gm" 'guix-apply-manifest
+
+ ;; sort
+ "o" 'bui-list-sort
+
+ ;; filter
+ "ss" 'bui-enable-filter
+ "sd" 'bui-disable-filter
+
+ ;; mark
+ "m" 'bui-list-mark
+ "M" 'bui-list-mark-all
+ "u" 'bui-list-unmark
+ "U" 'bui-list-unmark-all
+
+ (kbd "C-o") 'bui-history-back
+ (kbd "C-i") 'bui-history-forward
+
+ "g?" 'bui-show-hint
+ "gr" 'revert-buffer
+ "gR" 'bui-redisplay
+
+ ;; repl
+ "gz" 'guix-switch-to-repl
+
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'evil-quit
+ "ZZ" 'quit-window)))
+
+;;;###autoload
+(defun evil-collection-guix-setup ()
+ "Set up `evil' bindings for `guix'."
+ (evil-collection-guix-set guix-ui-map) ; Covers output-list and generation-list.
+
+ (evil-collection-define-key 'normal 'guix-output-list-mode-map
+ (kbd "RET") 'bui-list-describe
+
+ "gb" 'guix-package-list-latest-builds
+ "gG" 'guix-output-list-graph
+ "gl" 'guix-output-list-lint
+ "gs" 'guix-package-list-size
+
+ "a" 'guix-output-list-mark-upgrade
+ "A" 'guix-output-list-mark-upgrades
+ "d" 'guix-output-list-mark-delete
+ "gd" 'guix-output-list-edit
+ "i" 'guix-output-list-mark-install
+
+ ;; mark
+ "x" 'guix-output-list-execute)
+
+ (evil-collection-guix-set guix-package-info-mode-map)
+ (evil-collection-define-key 'normal 'guix-package-info-mode-map
+ "gG" 'guix-package-info-graph
+ "gl" 'guix-package-info-lint
+ "gs" 'guix-package-info-size
+
+ "a" 'guix-package-info-upgrade
+ "d" 'guix-package-info-delete
+ "gd" 'guix-package-info-edit
+ "i" 'guix-package-info-install)
+
+ (evil-collection-guix-set guix-profile-list-mode-map)
+ (evil-collection-define-key 'normal 'guix-profile-list-mode-map
+ (kbd "RET") 'bui-list-describe
+
+ "c" 'guix-profile-list-set-current ; TODO: Bind to "." as per the rationale?
+ "p" 'guix-profile-list-show-packages
+ "a" 'guix-profile-list-show-generations
+ "P" 'guix-profile-list-show-search-paths)
+
+ (evil-collection-guix-set guix-profile-info-mode-map)
+ (evil-collection-define-key 'normal 'guix-profile-info-mode-map
+ "gm" 'guix-profile-info-apply-manifest
+
+ "p" 'guix-profile-info-show-packages
+ "a" 'guix-profile-info-show-generations
+ "P" 'guix-profile-info-show-search-paths
+ "c" 'guix-profile-info-set-current)
+
+ (evil-collection-define-key 'normal 'guix-generation-list-mode-map
+ (kbd "RET") 'bui-list-describe
+
+ "p" 'guix-generation-list-show-packages
+ "D" 'guix-generation-list-mark-delete
+ "P" 'guix-generation-list-show-search-paths
+ "c" 'guix-generation-list-set-current
+ "d" 'guix-generation-list-ediff
+
+ "+" 'guix-generation-list-show-added-packages
+ "-" 'guix-generation-list-show-removed-packages
+ "=" 'guix-generation-list-diff
+
+ ;; mark
+ "x" 'guix-generation-list-execute)
+
+ (evil-collection-guix-set guix-license-list-mode-map)
+ (evil-collection-define-key 'normal 'guix-license-list-mode-map
+ (kbd "<tab>") 'forward-button ; Why isn't this binding inhibited?
+ (kbd "RET") 'bui-list-describe
+
+ "p" 'guix-license-list-show-packages
+ "gd" 'guix-license-list-edit)
+
+ (evil-collection-guix-set guix-license-info-mode-map)
+
+ (evil-collection-guix-set guix-location-list-mode-map)
+ (evil-collection-define-key 'normal 'guix-location-list-mode-map
+ (kbd "RET") 'guix-location-list-show-packages ; In Emacs state, it seems to be overriden by `push-button'.
+
+ "p" 'guix-location-list-show-packages
+ "gd" 'guix-location-list-edit)
+
+ (evil-collection-guix-set guix-store-item-list-mode-map)
+ (evil-collection-define-key 'normal 'guix-store-item-list-mode-map
+ (kbd "RET") 'bui-list-describe
+ "d" 'guix-store-item-list-mark-delete
+ "gd" 'guix-store-item-list-edit
+ "x" 'guix-store-item-list-execute)
+
+ (evil-collection-guix-set guix-store-item-info-mode-map)
+
+ (evil-collection-guix-set guix-hydra-build-list-mode-map)
+ (evil-collection-define-key 'normal 'guix-hydra-build-list-mode-map
+ (kbd "RET") 'bui-list-describe
+
+ "gb" 'guix-hydra-build-list-latest-builds
+ "gl" 'guix-hydra-build-list-view-log)
+
+ (evil-collection-guix-set guix-hydra-build-info-mode-map)
+
+ (evil-collection-inhibit-insert-state 'guix-build-log-mode-map)
+ (evil-collection-define-key 'normal 'guix-build-log-mode-map
+ ;; motion
+ (kbd "SPC") 'scroll-up-command
+ (kbd "S-SPC") 'scroll-down-command
+ (kbd "<tab>") 'guix-build-log-phase-toggle
+ (kbd "<backtab>") 'guix-build-log-phase-toggle-all
+
+ "gk" 'guix-build-log-previous-phase
+ "gj" 'guix-build-log-next-phase
+ "[[" 'guix-build-log-previous-phase
+ "]]" 'guix-build-log-next-phase
+ (kbd "C-k") 'guix-build-log-previous-phase
+ (kbd "C-j") 'guix-build-log-next-phase
+
+ "gr" 'revert-buffer
+
+ ;; repl
+ "gz" 'guix-switch-to-repl ; TODO: Does it still make sense here?
+
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'evil-quit
+ "ZZ" 'quit-window)
+
+ (evil-collection-guix-set guix-service-list-mode-map)
+ (evil-collection-define-key 'normal 'guix-service-list-mode-map
+ (kbd "<tab>") 'forward-button
+ (kbd "RET") 'bui-list-describe
+
+ "gd" 'guix-service-list-edit)
+
+ (evil-collection-define-key 'normal 'guix-devel-mode-map
+ ;; repl
+ "gz" 'guix-switch-to-repl))
+
+(provide 'evil-collection-guix)
+;;; evil-collection-guix.el ends here
diff --git a/modes/helm/evil-collection-helm.el b/modes/helm/evil-collection-helm.el
new file mode 100644
index 0000000..27418e4
--- /dev/null
+++ b/modes/helm/evil-collection-helm.el
@@ -0,0 +1,212 @@
+;;; evil-collection-helm.el --- Evil bindings for Helm -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, helm, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for Helm.
+
+;;; Code:
+(require 'evil-collection)
+(require 'helm-files nil t) ; TODO: Check if this is the ideal requirement and if we are not loading too much.
+
+;; To navigate Helm entries with <hjkl> in insert state, we need a modifier.
+;; Using the C- modifier would conflict with the help prefix "C-h". So we use
+;; M- prefixed bindings instead.
+
+;; Helm-find-files: We cannot use "h" and "l" in normal state to navigate up and
+;; down the file system hierarchy since we need them to use it to edit the
+;; minibuffer content.
+
+(defvar helm-map)
+(defvar helm-find-files-map)
+(defvar helm-generic-files-map)
+(defvar helm-buffer-map)
+(defvar helm-moccur-map)
+(defvar helm-grep-map)
+(defvar helm-read-file-map)
+(defvar helm-echo-input-in-header-line)
+(defvar helm--prompt)
+(defvar helm--action-prompt)
+(defvar helm-header-line-space-before-prompt)
+(defvar helm-default-prompt-display-function)
+
+(declare-function helm-window "helm-lib")
+
+(defconst evil-collection-helm-maps '(help-map
+ help-find-files-map
+ helm-read-file-map
+ helm-generic-files-map
+ helm-buffer-map
+ helm-moccur-map
+ helm-grep-map))
+
+;; From https://github.com/emacs-helm/helm/issues/362.
+;; Also see https://emacs.stackexchange.com/questions/17058/change-cursor-type-in-helm-header-line#17097.
+;; TODO: With Evil, the cursor type is not right in the header line and the evil
+;; cursor remains in the minibuffer. Visual selections also reveal overlayed
+;; text.
+(with-no-warnings
+ (defun evil-collection-helm-hide-minibuffer-maybe ()
+ "Hide text in minibuffer when `helm-echo-input-in-header-line' is non-nil."
+ (when (with-current-buffer (helm-buffer-get) helm-echo-input-in-header-line)
+ (let ((ov (make-overlay (point-min) (point-max) nil nil t)))
+ (overlay-put ov 'window (selected-window))
+ (overlay-put ov 'face (let ((bg-color (face-background 'default nil)))
+ `(:background ,bg-color :foreground ,bg-color)))
+ (setq-local cursor-type nil)))))
+
+(defun evil-collection-helm--set-prompt-display (pos)
+ (let (beg state region-active m)
+ (with-selected-window (minibuffer-window)
+ (setq beg (save-excursion (vertical-motion 0 (helm-window)) (point))
+ state evil-state
+ region-active (region-active-p)
+ m (mark t)))
+ (when region-active
+ (setq m (- m beg))
+ ;; Increment pos to handle the space before prompt (i.e `pref').
+ (put-text-property (1+ (min m pos)) (+ 2 (max m pos))
+ 'face
+ (list :background (face-background 'region))
+ header-line-format))
+ (put-text-property
+ ;; Increment pos to handle the space before prompt (i.e `pref').
+ (+ 1 pos) (+ 2 pos)
+ 'face
+ (if (eq state 'insert)
+ 'underline
+ ;; Don't just use 'cursor, this can hide the current character.
+ (list :inverse-video t
+ :foreground (face-background 'cursor)
+ :background (face-background 'default)))
+ header-line-format)))
+
+
+;;;###autoload
+(defun evil-collection-helm-setup ()
+ "Set up `evil' bindings for `helm'."
+ (add-hook 'helm-minibuffer-set-up-hook 'evil-collection-helm-hide-minibuffer-maybe)
+ (setq helm-default-prompt-display-function 'evil-collection-helm--set-prompt-display)
+
+ (evil-collection-define-key '(insert normal) 'helm-map
+ (kbd "M-[") 'helm-previous-source
+ (kbd "M-]") 'helm-next-source
+ (kbd "M-l") 'helm-execute-persistent-action
+ (kbd "M-j") 'helm-next-line
+ (kbd "M-k") 'helm-previous-line
+ (kbd "C-f") 'helm-next-page
+ (kbd "C-b") 'helm-previous-page)
+
+ (dolist (map '(helm-find-files-map helm-read-file-map))
+ (evil-collection-define-key 'normal map
+ "go" 'helm-ff-run-switch-other-window
+ "/" 'helm-ff-run-find-sh-command)
+ (evil-collection-define-key '(insert normal) map
+ (kbd "S-<return>") 'helm-ff-run-switch-other-window
+ (kbd "M-h") 'helm-find-files-up-one-level))
+
+ ;; TODO: Change the Helm header to display "M-l" instead of "C-l". We don't
+ ;; want to modify the Emacs Helm map.
+
+ (evil-collection-define-key '(insert normal) 'helm-generic-files-map
+ (kbd "S-<return>") 'helm-ff-run-switch-other-window)
+
+ (evil-collection-define-key '(insert normal) 'helm-buffer-map
+ (kbd "S-<return>") 'helm-buffer-switch-other-window
+ (kbd "M-<return>") 'display-buffer)
+
+ (evil-collection-define-key '(insert normal) 'helm-moccur-map
+ (kbd "S-<return>") 'helm-moccur-run-goto-line-ow)
+
+ (evil-collection-define-key '(insert normal) 'helm-grep-map
+ (kbd "S-<return>") 'helm-grep-run-other-window-action)
+
+ (evil-collection-define-key 'normal 'helm-generic-files-map
+ "go" 'helm-ff-run-switch-other-window)
+
+ (evil-collection-define-key 'normal 'helm-buffer-map
+ "go" 'helm-buffer-switch-other-window
+ "gO" 'display-buffer
+ "=" 'helm-buffer-run-ediff
+ "%" 'helm-buffer-run-query-replace-regexp
+ "D" 'helm-buffer-run-kill-persistent ; Ivy has "D".
+ )
+
+ (evil-collection-define-key 'normal 'helm-moccur-map
+ "go" 'helm-moccur-run-goto-line-ow)
+
+ (evil-collection-define-key 'normal 'helm-grep-map
+ "go" 'helm-grep-run-other-window-action)
+
+ (evil-collection-define-key 'normal 'helm-find-files-map
+ "=" 'helm-ff-run-ediff-file
+ "%" 'helm-ff-run-query-replace-regexp
+ "D" 'helm-ff-run-delete-file) ; Ivy has "D".
+
+ ;; These helm bindings should always exist, the evil equivalents do
+ ;; nothing useful in the minibuffer (error or pure failure).
+ ;; RET can't do a second line in the minibuffer.
+ ;; The C-n/C-p completions error with 'helm in helm' session.
+ ;; C-o switches to evil state (again, not useful).
+ (evil-collection-define-key '(insert normal) 'helm-map
+ (kbd "RET") 'helm-maybe-exit-minibuffer
+ (kbd "M-v") 'helm-previous-page
+ (kbd "C-v") 'helm-next-page
+ (kbd "C-p") 'helm-previous-line
+ (kbd "C-n") 'helm-next-line
+ (kbd "C-o") 'helm-next-source)
+
+ (when evil-want-C-u-scroll
+ (evil-collection-define-key 'normal 'helm-map
+ (kbd "C-u") 'helm-previous-page))
+
+ (when evil-want-C-d-scroll
+ (evil-collection-define-key 'normal 'helm-map
+ (kbd "C-d") 'helm-next-page))
+
+ (evil-collection-define-key 'normal 'helm-map
+ (kbd "<tab>") 'helm-select-action ; TODO: Ivy has "ga".
+ (kbd "[[") 'helm-previous-source
+ (kbd "]]") 'helm-next-source
+ "gk" 'helm-previous-source
+ "gj" 'helm-next-source
+ (kbd "(") 'helm-prev-visible-mark
+ (kbd ")") 'helm-next-visible-mark
+ "j" 'helm-next-line
+ "k" 'helm-previous-line
+ "gg" 'helm-beginning-of-buffer
+ "G" 'helm-end-of-buffer
+
+ "/" 'helm-quit-and-find-file
+
+ ;; refresh
+ "gr" 'helm-refresh
+
+ "yp" 'helm-yank-selection
+ "yP" 'helm-copy-to-buffer
+ "yy" 'helm-kill-selection-and-quit
+ (kbd "SPC") 'helm-toggle-visible-mark))
+
+(provide 'evil-collection-helm)
+;;; evil-collection-helm.el ends here
diff --git a/modes/help/evil-collection-help.el b/modes/help/evil-collection-help.el
new file mode 100644
index 0000000..b69b03d
--- /dev/null
+++ b/modes/help/evil-collection-help.el
@@ -0,0 +1,75 @@
+;;; evil-collection-help.el --- Evil bindings for help-mode -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, help, tools
+
+;; 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:
+;; Evil bindings for `help-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'help-mode)
+
+(defconst evil-collection-help-maps '(help-mode-map))
+
+;;;###autoload
+(defun evil-collection-help-setup ()
+ "Set up `evil' bindings for `help'."
+ (evil-set-initial-state 'help-mode 'normal)
+ (evil-collection-inhibit-insert-state 'help-mode-map)
+ (evil-collection-define-key 'normal 'help-mode-map
+ ;; motion
+ (kbd "SPC") 'scroll-up-command
+ (kbd "S-SPC") 'scroll-down-command
+ (kbd "C-f") 'scroll-up-command
+ (kbd "C-b") 'scroll-down-command
+ (kbd "<tab>") 'forward-button
+ (kbd "<backtab>") 'backward-button
+
+ (kbd "C-o") 'help-go-back
+ (kbd "C-i") 'help-go-forward
+
+ ;; TODO: Enable more help-go-* bindings?
+ ;; "gj" 'help-go-forward
+ ;; "gk" 'help-go-back
+ ;; "\C-j" 'help-go-forward
+ ;; "\C-k" 'help-go-back
+
+ ;; The following bindings don't do what they are supposed to. "go" should open
+ ;; in the same window and "gO" should open in a different one.
+ "go" 'push-button
+ "gO" 'push-button
+
+ "g?" 'describe-mode
+ "gr" 'revert-buffer
+ "<" 'help-go-back
+ ">" 'help-go-forward
+ "r" 'help-follow
+
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'evil-quit
+ "ZZ" 'quit-window))
+
+(provide 'evil-collection-help)
+;;; evil-collection-help.el ends here
diff --git a/modes/ibuffer/evil-collection-ibuffer.el b/modes/ibuffer/evil-collection-ibuffer.el
new file mode 100644
index 0000000..b4c0a9c
--- /dev/null
+++ b/modes/ibuffer/evil-collection-ibuffer.el
@@ -0,0 +1,197 @@
+;;; evil-collection-ibuffer.el --- Evil bindings for IBuffer -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, ibuffer, tools
+
+;; 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:
+;; Evil bindings for IBuffer.
+
+;;; Code:
+(require 'evil-collection)
+(require 'ibuffer)
+
+(defconst evil-collection-ibuffer-maps '(ibuffer-mode-map))
+
+;;;###autoload
+(defun evil-collection-ibuffer-setup ()
+ "Set up `evil' bindings for `ibuffer'."
+ (evil-set-initial-state 'ibuffer-mode 'normal)
+
+ (evil-collection-define-key 'normal 'ibuffer-mode-map
+ (kbd "C-d") (if evil-want-C-d-scroll
+ 'evil-scroll-down
+ 'ibuffer-mark-for-delete-backwards))
+
+ (evil-collection-define-key 'normal 'ibuffer-mode-map
+ (kbd "=") 'ibuffer-diff-with-file
+ (kbd "J") 'ibuffer-jump-to-buffer
+ (kbd "M-g") 'ibuffer-jump-to-buffer
+ (kbd "M-s a C-s") 'ibuffer-do-isearch
+ (kbd "M-s a M-C-s") 'ibuffer-do-isearch-regexp
+ (kbd "M-s a C-o") 'ibuffer-do-occur
+
+ ;; mark
+ (kbd "m") 'ibuffer-mark-forward
+ (kbd "~") 'ibuffer-toggle-marks
+ (kbd "u") 'ibuffer-unmark-forward
+ (kbd "DEL") 'ibuffer-unmark-backward
+ (kbd "M-DEL") 'ibuffer-unmark-all
+ (kbd "* *") 'ibuffer-unmark-all
+ (kbd "* c") 'ibuffer-change-marks
+ (kbd "U") 'ibuffer-unmark-all-marks
+ (kbd "* M") 'ibuffer-mark-by-mode
+ (kbd "* m") 'ibuffer-mark-modified-buffers
+ (kbd "* u") 'ibuffer-mark-unsaved-buffers
+ (kbd "* s") 'ibuffer-mark-special-buffers
+ (kbd "* r") 'ibuffer-mark-read-only-buffers
+ (kbd "* /") 'ibuffer-mark-dired-buffers
+ (kbd "* e") 'ibuffer-mark-dissociated-buffers
+ (kbd "* h") 'ibuffer-mark-help-buffers
+ (kbd "* z") 'ibuffer-mark-compressed-file-buffers
+ (kbd ".") 'ibuffer-mark-old-buffers
+
+ (kbd "d") 'ibuffer-mark-for-delete
+ (kbd "x") 'ibuffer-do-kill-on-deletion-marks
+
+ ;; immediate operations
+ (kbd "gj") 'ibuffer-forward-line
+ (kbd "gk") 'ibuffer-backward-line
+
+ (kbd "}") 'ibuffer-forward-next-marked
+ (kbd "{") 'ibuffer-backwards-next-marked
+ (kbd "M-}") 'ibuffer-forward-next-marked
+ (kbd "M-{") 'ibuffer-backwards-next-marked
+
+ (kbd "gR") 'ibuffer-redisplay
+ (kbd "gr") 'ibuffer-update
+
+ "`" 'ibuffer-switch-format
+ "-" 'ibuffer-add-to-tmp-hide
+ "+" 'ibuffer-add-to-tmp-show
+ "X" 'ibuffer-bury-buffer
+ (kbd ",") 'ibuffer-toggle-sorting-mode
+ (kbd "o i") 'ibuffer-invert-sorting
+ (kbd "o a") 'ibuffer-do-sort-by-alphabetic
+ (kbd "o v") 'ibuffer-do-sort-by-recency
+ (kbd "o s") 'ibuffer-do-sort-by-size
+ (kbd "o f") 'ibuffer-do-sort-by-filename/process
+ (kbd "o m") 'ibuffer-do-sort-by-major-mode
+
+ (kbd "s RET") 'ibuffer-filter-by-mode
+ (kbd "s m") 'ibuffer-filter-by-used-mode
+ (kbd "s M") 'ibuffer-filter-by-derived-mode
+ (kbd "s n") 'ibuffer-filter-by-name
+ (kbd "s *") 'ibuffer-filter-by-starred-name
+ (kbd "s f") 'ibuffer-filter-by-filename
+ (kbd "s b") 'ibuffer-filter-by-basename
+ (kbd "s .") 'ibuffer-filter-by-file-extension
+ (kbd "s <") 'ibuffer-filter-by-size-lt
+ (kbd "s >") 'ibuffer-filter-by-size-gt
+ (kbd "s i") 'ibuffer-filter-by-modified
+ (kbd "s v") 'ibuffer-filter-by-visiting-file
+ (kbd "s c") 'ibuffer-filter-by-content
+ (kbd "s e") 'ibuffer-filter-by-predicate
+
+ (kbd "s r") 'ibuffer-switch-to-saved-filters
+ (kbd "s a") 'ibuffer-add-saved-filters
+ (kbd "s x") 'ibuffer-delete-saved-filters
+ (kbd "s d") 'ibuffer-decompose-filter
+ (kbd "s s") 'ibuffer-save-filters
+ (kbd "s p") 'ibuffer-pop-filter
+ (kbd "s <up>") 'ibuffer-pop-filter
+ (kbd "s !") 'ibuffer-negate-filter
+ (kbd "s t") 'ibuffer-exchange-filters
+ (kbd "s TAB") 'ibuffer-exchange-filters
+ (kbd "s o") 'ibuffer-or-filter
+ (kbd "s |") 'ibuffer-or-filter
+ (kbd "s &") 'ibuffer-and-filter
+ (kbd "s g") 'ibuffer-filters-to-filter-group
+ (kbd "s P") 'ibuffer-pop-filter-group
+ (kbd "s S-<up>") 'ibuffer-pop-filter-group
+ (kbd "s D") 'ibuffer-decompose-filter-group
+ (kbd "s /") 'ibuffer-filter-disable
+
+ (kbd "C-j") 'ibuffer-forward-filter-group
+ (kbd "M-n") 'ibuffer-forward-filter-group
+ (kbd "]]") 'ibuffer-forward-filter-group
+ "\t" 'ibuffer-forward-filter-group
+ (kbd "M-p") 'ibuffer-backward-filter-group
+ (kbd "C-k") 'ibuffer-backward-filter-group
+ (kbd "[[") 'ibuffer-backward-filter-group
+ [backtab] 'ibuffer-backward-filter-group
+ (kbd "M-j") 'ibuffer-jump-to-filter-group
+ (kbd "gx") 'ibuffer-kill-line
+ (kbd "C-y") 'ibuffer-yank
+ (kbd "s S") 'ibuffer-save-filter-groups
+ (kbd "s R") 'ibuffer-switch-to-saved-filter-groups
+ (kbd "s X") 'ibuffer-delete-saved-filter-groups
+ (kbd "s \\") 'ibuffer-clear-filter-groups
+
+ (kbd "% n") 'ibuffer-mark-by-name-regexp
+ (kbd "% m") 'ibuffer-mark-by-mode-regexp
+ (kbd "% f") 'ibuffer-mark-by-file-name-regexp
+ (kbd "% g") 'ibuffer-mark-by-content-regexp
+ (kbd "% L") 'ibuffer-mark-by-locked
+
+ (kbd "C-t") 'ibuffer-visit-tags-table
+
+ (kbd "|") 'ibuffer-do-shell-command-pipe
+ (kbd "!") 'ibuffer-do-shell-command-file
+ (kbd "t") 'ibuffer-do-toggle-modified
+ ;; marked operations
+ (kbd "A") 'ibuffer-do-view
+ (kbd "D") 'ibuffer-do-delete
+ (kbd "E") 'ibuffer-do-eval
+ (kbd "F") 'ibuffer-do-shell-command-file
+ (kbd "I") 'ibuffer-do-query-replace-regexp
+ (kbd "H") 'ibuffer-do-view-other-frame
+ (kbd "N") 'ibuffer-do-shell-command-pipe-replace
+ (kbd "M") 'ibuffer-do-toggle-modified
+ (kbd "O") 'ibuffer-do-occur
+ (kbd "P") 'ibuffer-do-print
+ (kbd "Q") 'ibuffer-do-query-replace
+ (kbd "R") 'ibuffer-do-rename-uniquely
+ (kbd "S") 'ibuffer-do-save
+ (kbd "T") 'ibuffer-do-toggle-read-only
+ (kbd "r") 'ibuffer-do-replace-regexp
+ (kbd "V") 'ibuffer-do-revert
+ (kbd "W") 'ibuffer-do-view-and-eval
+
+ (kbd "K") 'ibuffer-do-kill-lines
+ (kbd "yf") 'ibuffer-copy-filename-as-kill
+ (kbd "yb") 'ibuffer-copy-buffername-as-kill
+
+ (kbd "RET") 'ibuffer-visit-buffer
+ (kbd "go") 'ibuffer-visit-buffer-other-window
+ (kbd "C-o") 'ibuffer-visit-buffer-other-window-noselect
+ (kbd "M-o") 'ibuffer-visit-buffer-1-window
+ (kbd "gv") 'ibuffer-do-view
+ (kbd "gV") 'ibuffer-do-view-horizontally
+
+ ;; Quit
+ "q" 'quit-window
+ "ZZ" 'quit-window
+ "ZQ" 'quit-window))
+
+(provide 'evil-collection-ibuffer)
+;;; evil-collection-ibuffer.el ends here
diff --git a/modes/image+/evil-collection-image+.el b/modes/image+/evil-collection-image+.el
new file mode 100644
index 0000000..bf87845
--- /dev/null
+++ b/modes/image+/evil-collection-image+.el
@@ -0,0 +1,54 @@
+;;; evil-collection-image+.el --- Evil bindings for image-mode with image+ -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, image, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for image-mode with image+.
+
+;;; Code:
+(require 'evil-collection)
+(require 'image+ nil t)
+
+(defconst evil-collection-image+-maps '(image-mode-map))
+
+;;;###autoload
+(defun evil-collection-image+-setup ()
+ "Set up `evil' bindings for `image+'."
+ (evil-collection-define-key 'normal 'image-mode-map
+ ;; zoom
+ "+" 'imagex-sticky-zoom-in
+ "=" 'imagex-sticky-zoom-in
+ "-" 'imagex-sticky-zoom-out
+ "O" 'imagex-sticky-restore-original
+
+ "M" 'imagex-sticky-maximize
+ "m" 'imagex-auto-adjust-mode
+ "S" 'imagex-sticky-save-image
+ "r" 'imagex-sticky-rotate-right
+ "R" 'imagex-sticky-rotate-left
+ "<" 'imagex-sticky-rotate-left ; like sxiv
+ ">" 'imagex-sticky-rotate-right)) ; like sxiv
+
+(provide 'evil-collection-image+)
+;;; evil-collection-image+.el ends here
diff --git a/modes/image/evil-collection-image.el b/modes/image/evil-collection-image.el
new file mode 100644
index 0000000..9a679b6
--- /dev/null
+++ b/modes/image/evil-collection-image.el
@@ -0,0 +1,92 @@
+;;; evil-collection-image.el --- Evil bindings for Image -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, bookmark, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for `image-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'image-mode)
+
+;; TODO: pdf and doc-view conflict with image.
+;; See https://github.com/emacs-evil/evil-collection/issues/23.
+
+(defconst evil-collection-image-maps '(image-mode-map))
+
+;;;###autoload
+(defun evil-collection-image-setup ()
+ "Set up `evil' bindings for `image-mode'."
+ (evil-set-initial-state 'image-mode 'normal)
+
+ (evil-collection-define-key 'normal 'image-mode-map
+ ;; motion
+ "gg" 'image-bob
+ "G" 'image-eob
+ "h" 'image-backward-hscroll
+ "l" 'image-forward-hscroll
+ "j" 'image-next-line
+ "k" 'image-previous-line
+ "0" 'image-bol
+ "^" 'image-bol
+ "$" 'image-eol
+ (kbd "C-d") 'image-scroll-up
+ (kbd "SPC") 'image-scroll-up
+ (kbd "S-SPC") 'image-scroll-down
+ (kbd "<delete>") 'image-scroll-down
+ ;; animation
+ (kbd "RET") 'image-toggle-animation
+ "a0" 'image-reset-speed
+ "ar" 'image-reverse-speed
+ "F" 'image-goto-frame
+ "," 'image-previous-frame ; mplayer/mpv style
+ "." 'image-next-frame ; mplayer/mpv style
+ ";" 'image-next-frame ; Evil style
+ "{" 'image-decrease-speed ; mplayer/mpv style
+ "}" 'image-increase-speed ; mplayer/mpv style
+
+ "H" 'image-transform-fit-to-height
+ "W" 'image-transform-fit-to-width
+
+ "[[" 'image-previous-file
+ "]]" 'image-next-file
+ "gk" 'image-previous-file
+ "gj" 'image-next-file
+ (kbd "C-k") 'image-previous-file
+ (kbd "C-j") 'image-next-file
+
+ (kbd "C-c C-c") 'image-toggle-display
+
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'evil-quit
+ "ZZ" 'quit-window)
+
+ ;; TODO: What if the user changes `evil-want-C-u-scroll' after this is run?
+ (when evil-want-C-u-scroll
+ (evil-collection-define-key 'normal 'image-mode-map
+ (kbd "C-u") 'image-scroll-down)))
+
+(provide 'evil-collection-image)
+;;; evil-collection-image.el ends here
diff --git a/modes/imenu-list/evil-collection-imenu-list.el b/modes/imenu-list/evil-collection-imenu-list.el
new file mode 100644
index 0000000..5d643a9
--- /dev/null
+++ b/modes/imenu-list/evil-collection-imenu-list.el
@@ -0,0 +1,47 @@
+;;; evil-collection-imenu-list.el --- Bindings for `imenu-list' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2018 James Nguyen
+
+;; Author: Fredrik Bergroth <fbergroth@gmail.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;; Bindings for `imenu-list'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'imenu-list nil t)
+
+(defconst evil-collection-imenu-list-maps '(imenu-list-major-mode-map))
+
+;;;###autoload
+(defun evil-collection-imenu-list-setup ()
+ "Set up `evil' bindings for `imenu-list'."
+ (evil-collection-define-key 'normal 'imenu-list-major-mode-map
+ (kbd "RET") 'imenu-list-goto-entry
+ (kbd "TAB") 'hs-toggle-hiding
+ "d" 'imenu-list-display-entry
+ "gr" 'imenu-list-refresh
+ "q" 'imenu-list-quit-window))
+
+
+(provide 'evil-collection-imenu-list)
+;;; evil-collection-imenu-list.el ends here
diff --git a/modes/indium/evil-collection-indium.el b/modes/indium/evil-collection-indium.el
new file mode 100644
index 0000000..0d799ce
--- /dev/null
+++ b/modes/indium/evil-collection-indium.el
@@ -0,0 +1,110 @@
+;;; evil-collection-indium.el --- Bindings for `indium'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: emacs, indium, javascript, tools
+
+;; 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:
+;; Bindings for `indium'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'indium nil t)
+
+(defconst evil-collection-indium-maps '(indium-debugger-mode-map
+ indium-inspector-mode-map
+ indium-debugger-locals-mode-map
+ indium-debugger-frames-mode-map
+ indium-interaction-mode-map
+ indium-repl-mode-map))
+
+;;;###autoload
+(defun evil-collection-indium-setup ()
+ "Set up `evil' bindings for `indium'."
+ (when evil-collection-setup-debugger-keys
+ (evil-collection-define-key 'normal 'indium-debugger-mode-map
+ "n" 'indium-debugger-step-over
+ "i" 'indium-debugger-step-into
+ "o" 'indium-debugger-step-out
+ "c" 'indium-debugger-resume
+ "L" 'indium-debugger-locals
+ "s" 'indium-debugger-stack-frames
+ "q" 'indium-debugger-resume
+ "H" 'indium-debugger-here
+ "e" 'indium-debugger-evaluate
+ ">" 'indium-debugger-next-frame
+ "<" 'indium-debugger-previous-frame)
+
+ (add-hook 'indium-debugger-mode-hook #'evil-normalize-keymaps))
+
+ (evil-collection-define-key 'normal 'indium-inspector-mode-map
+ "q" 'quit-window
+ (kbd "RET") 'indium-follow-link
+ [mouse-1] 'indium-follow-link
+ "L" 'indium-inspector-pop
+ "gr" 'indium-inspector-refresh
+ "gj" 'indium-inspector-next-reference
+ "gk" 'indium-inspector-previous-reference
+ (kbd "C-j") 'indium-inspector-next-reference
+ (kbd "C-k") 'indium-inspector-previous-reference
+ [tab] 'indium-inspector-next-reference
+ [backtab] 'indium-inspector-previous-reference)
+
+ (evil-collection-define-key 'normal 'indium-debugger-locals-mode-map
+ "q" 'quit-window
+ "L" nil
+ "gr" nil)
+
+ (evil-collection-define-key 'normal 'indium-debugger-frames-mode-map
+ "q" 'quit-window
+ [return] 'indium-follow-link
+ (kbd "RET") 'indium-follow-link
+ (kbd "gj") 'indium-debugger-frames-next-frame
+ (kbd "gk") 'indium-debugger-frames-previous-frame
+ (kbd "C-j") 'indium-debugger-frames-next-frame
+ (kbd "C-k") 'indium-debugger-frames-previous-frame
+ [tab] 'indium-debugger-frames-next-frame
+ [backtab] 'indium-debugger-frames-previous-frame)
+
+ (evil-collection-define-key 'normal 'indium-interaction-mode-map
+ "gr" 'indium-update-script-source
+ "gz" 'indium-switch-to-repl-buffer)
+
+ (when evil-collection-setup-debugger-keys
+ (evil-collection-define-key 'normal 'indium-interaction-mode-map
+ [left-fringe mouse-1] 'indium-mouse-toggle-breakpoint
+ [left-margin mouse-1] 'indium-mouse-toggle-breakpoint
+ [f5] 'indium-debugger-resume
+ [S-f5] 'indium-debugger-resume
+ [f9] 'indium-toggle-breakpoint
+ [f10] 'indium-debugger-step-over
+ [f11] 'indium-debugger-step-into
+ [S-f11] 'indium-debugger-step-out))
+
+ (evil-collection-define-key 'normal 'indium-repl-mode-map
+ (kbd "gj") 'indium-repl-next-input
+ (kbd "gk") 'indium-repl-previous-input
+ (kbd "C-j") 'indium-repl-next-input
+ (kbd "C-k") 'indium-repl-previous-input))
+
+(provide 'evil-collection-indium)
+;;; evil-collection-indium.el ends here
diff --git a/modes/info/evil-collection-info.el b/modes/info/evil-collection-info.el
new file mode 100644
index 0000000..f9845f0
--- /dev/null
+++ b/modes/info/evil-collection-info.el
@@ -0,0 +1,114 @@
+;;; evil-collection-info.el --- Evil bindings for Info-mode -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, info, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; The default bindings in motion state override the standard movement keys.
+;; This package uses normal state and redefines everything.
+
+;;; Code:
+(require 'evil-collection)
+(require 'info)
+
+(defconst evil-collection-info-maps '(Info-mode-map))
+
+;;;###autoload
+(defun evil-collection-info-setup ()
+ "Set up `evil' bindings for `info-mode'."
+ (evil-collection-inhibit-insert-state 'Info-mode-map)
+ (evil-set-initial-state 'Info-mode 'normal)
+
+ (evil-collection-define-key 'normal 'Info-mode-map
+ "l" 'evil-forward-char
+ "h" 'evil-backward-char
+ (kbd "<tab>") 'Info-next-reference
+ (kbd "S-<tab>") 'Info-prev-reference
+
+ ;; From evil-integration.el.
+ "0" 'evil-digit-argument-or-evil-beginning-of-line
+ (kbd "M-h") 'Info-help ; "h"
+ (kbd "C-t") 'Info-history-back ; "l"
+ (kbd "C-o") 'Info-history-back
+ " " 'Info-scroll-up
+ (kbd "C-]") 'Info-follow-nearest-node
+ (kbd "DEL") 'Info-scroll-down
+ ;; Add "C-i" for consistency.
+ (kbd "C-i") 'Info-history-forward
+
+ "d" 'Info-directory
+ "u" 'Info-up
+ "L" 'Info-history
+ "s" 'Info-search
+ "S" 'Info-search-case-sensitively
+ "i" 'Info-index
+ "I" 'Info-virtual-index
+ "a" 'info-apropos
+ "m" 'Info-menu
+ "w" 'evil-forward-word-begin
+ "b" 'evil-backward-word-begin
+
+ "gg" 'evil-goto-first-line
+
+ ;; TODO: Restore digit arguments? Use g[n] instead.
+
+ ;; TODO: Should search with "n"/"N" cover the full manual like "C-s"/"C-r" does?
+ ;; TODO: Directions?
+ "n" (if (evil-collection-evil-search-enabled)
+ evil-collection-evil-search-next
+ 'isearch-repeat-forward)
+ "N" (if (evil-collection-evil-search-enabled)
+ evil-collection-evil-search-previous
+ 'isearch-repeat-backward)
+
+ ;; goto
+ "gd" 'Info-goto-node ; TODO: "gd" does not match the rationale of "go to definition". Change?
+ "gm" 'Info-menu
+ "gt" 'Info-top-node
+ "gT" 'Info-toc
+ "gf" 'Info-follow-reference
+ ;; TODO: "[" and "]" are Emacs default for fine-grained browsing.
+ ;; We usually use "C-j"/"C-k" for that.
+ (kbd "C-j") 'Info-next
+ (kbd "C-k") 'Info-prev
+ "gj" 'Info-next
+ "gk" 'Info-prev
+
+
+ ;; quit
+ "q" 'Info-exit
+ "ZQ" 'evil-quit
+ "ZZ" 'Info-exit)
+
+ (evil-collection-define-key 'operator 'Info-mode-map
+ "u" '(menu-item ; Like eww.
+ ""
+ nil
+ :filter (lambda (&optional _)
+ (when (memq evil-this-operator
+ evil-collection-yank-operators)
+ (setq evil-inhibit-operator t)
+ #'Info-copy-current-node-name)))))
+
+(provide 'evil-collection-info)
+;;; evil-collection-info.el ends here
diff --git a/modes/ivy/evil-collection-ivy.el b/modes/ivy/evil-collection-ivy.el
new file mode 100644
index 0000000..7e6f0ad
--- /dev/null
+++ b/modes/ivy/evil-collection-ivy.el
@@ -0,0 +1,111 @@
+;;; evil-collection-ivy.el --- Evil bindings for ivy -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, ivy, tools
+
+;; 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:
+;; Evil bindings for `ivy-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'ivy nil t)
+
+(defconst evil-collection-ivy-maps '(ivy-occur-mode-map
+ ivy-occur-grep-mode-map
+ ivy-minibuffer-map))
+
+;;;###autoload
+(defun evil-collection-ivy-setup ()
+ "Set up `evil' bindings for `ivy-mode'."
+ (evil-collection-define-key nil 'ivy-mode-map
+ (kbd "<escape>") 'minibuffer-keyboard-quit)
+ (evil-collection-define-key 'normal 'ivy-occur-mode-map
+ [mouse-1] 'ivy-occur-click
+ (kbd "RET") 'ivy-occur-press-and-switch
+ "j" 'ivy-occur-next-line
+ "k" 'ivy-occur-previous-line
+ "h" 'evil-backward-char
+ "l" 'evil-forward-char
+ "g" nil
+ "gg" 'evil-goto-first-line
+ "gf" 'ivy-occur-press
+ "ga" 'ivy-occur-read-action
+ "go" 'ivy-occur-dispatch
+ "gc" 'ivy-occur-toggle-calling
+
+ ;; refresh
+ "gr" 'ivy-occur-revert-buffer
+
+ ;; quit
+ "q" 'quit-window)
+
+ (when evil-want-C-d-scroll
+ (evil-collection-define-key 'normal 'ivy-occur-grep-mode-map
+ "D" 'ivy-occur-delete-candidate
+ (kbd "C-d") 'evil-scroll-down))
+
+ (evil-collection-define-key 'visual 'ivy-occur-grep-mode-map
+ "j" 'evil-next-line
+ "k" 'evil-previous-line)
+
+ (evil-collection-define-key 'normal 'ivy-occur-grep-mode-map
+ "d" 'ivy-occur-delete-candidate
+ (kbd "C-x C-q") 'ivy-wgrep-change-to-wgrep-mode
+ "i" 'ivy-wgrep-change-to-wgrep-mode
+ "gd" 'ivy-occur-delete-candidate
+ [mouse-1] 'ivy-occur-click
+ (kbd "RET") 'ivy-occur-press-and-switch
+ "j" 'ivy-occur-next-line
+ "k" 'ivy-occur-previous-line
+ "h" 'evil-backward-char
+ "l" 'evil-forward-char
+ "g" nil
+ "gg" 'evil-goto-first-line
+ "gf" 'ivy-occur-press
+ "gr" 'ivy-occur-revert-buffer
+ "ga" 'ivy-occur-read-action
+ "go" 'ivy-occur-dispatch
+ "gc" 'ivy-occur-toggle-calling
+
+ "0" 'evil-digit-argument-or-evil-beginning-of-line
+
+ ;; quit
+ "q" 'quit-window)
+
+ (defvar evil-collection-setup-minibuffer)
+ (when evil-collection-setup-minibuffer
+ (evil-collection-define-key 'normal 'ivy-minibuffer-map
+ (kbd "<escape>") 'abort-recursive-edit
+ (kbd "RET") 'exit-minibuffer
+ (kbd "C-m") 'ivy-done
+ "j" 'ivy-next-line
+ "k" 'ivy-previous-line)
+
+ (evil-collection-define-key 'insert 'ivy-minibuffer-map
+ [backspace] 'ivy-backward-delete-char
+ (kbd "C-r") 'ivy-reverse-i-search
+ (kbd "C-n") 'ivy-next-line
+ (kbd "C-p") 'ivy-previous-line)))
+
+(provide 'evil-collection-ivy)
+;;; evil-collection-ivy.el ends here
diff --git a/modes/js2-mode/evil-collection-js2-mode.el b/modes/js2-mode/evil-collection-js2-mode.el
new file mode 100644
index 0000000..aeee0bd
--- /dev/null
+++ b/modes/js2-mode/evil-collection-js2-mode.el
@@ -0,0 +1,46 @@
+;;; evil-collection-js2-mode.el --- Bindings for `js2-mode' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;;; Bindings for `js2-mode'
+
+;;; Code:
+(require 'evil-collection)
+(require 'js2-mode nil t)
+
+(defvar js-indent-level)
+
+(defun evil-collection-js2-set-evil-shift-width ()
+ "Set `evil-shift-width' according to `js-indent-level'."
+ (setq-local evil-shift-width js-indent-level))
+
+;;;###autoload
+(defun evil-collection-js2-mode-setup ()
+ "Set up `evil' bindings for `js2-mode'."
+ (add-hook 'js2-mode-hook #'evil-collection-js2-set-evil-shift-width)
+ (add-hook 'js2-jsx-mode-hook #'evil-collection-js2-set-evil-shift-width))
+
+(provide 'evil-collection-js2-mode)
+;;; evil-collection-js2-mode.el ends here
diff --git a/modes/kotlin-mode/evil-collection-kotlin-mode.el b/modes/kotlin-mode/evil-collection-kotlin-mode.el
new file mode 100644
index 0000000..5bb601f
--- /dev/null
+++ b/modes/kotlin-mode/evil-collection-kotlin-mode.el
@@ -0,0 +1,42 @@
+;;; evil-collection-kotlin-mode.el --- Bindings for `kotlin-mode'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: emacs, evil, tools
+
+;; 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:
+;;; Bindings for `kotlin-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'kotlin-mode nil t)
+
+(defconst evil-collection-kotlin-maps '(kotlin-mode-map))
+
+;;;###autoload
+(defun evil-collection-kotlin-mode-setup ()
+ "Set up `evil' bindings for `kotlin-mode'."
+ (evil-collection-define-key 'normal 'kotlin-mode-map
+ "gz" 'kotlin-repl))
+
+(provide 'evil-collection-kotlin-mode)
+;;; evil-collection-kotlin-mode.el ends here
diff --git a/modes/log-view/evil-collection-log-view.el b/modes/log-view/evil-collection-log-view.el
new file mode 100644
index 0000000..dcfa08c
--- /dev/null
+++ b/modes/log-view/evil-collection-log-view.el
@@ -0,0 +1,63 @@
+;;; evil-collection-log-view.el --- Bindings for `log-view' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;; Bindings for `log-view'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'log-view)
+
+(defconst evil-collection-log-view-maps '(log-view-mode-map))
+
+;;;###autoload
+(defun evil-collection-log-view-setup ()
+ "Set up `evil' bindings for `log-view'."
+
+ ;; Currently vc has these various log-view modes
+ (evil-set-initial-state 'vc-hg-log-view-mode 'normal)
+ (evil-set-initial-state 'vc-git-log-view-mode 'normal)
+ (evil-set-initial-state 'vc-svn-log-view-mode 'normal)
+
+ (evil-collection-define-key 'normal 'log-view-mode-map
+ "q" 'quit-window
+ (kbd "TAB") 'log-view-toggle-entry-display
+ "m" 'log-view-toggle-mark-entry
+ "c" 'log-view-modify-change-comment
+ (kbd "RET") 'log-view-diff
+ "d" 'log-view-diff
+ "=" 'log-view-diff
+ "D" 'log-view-diff-changeset
+ "a" 'log-view-annotate-version
+ "F" 'log-view-find-revision
+ "gj" 'log-view-msg-next
+ "gk" 'log-view-msg-prev
+ "]]" 'log-view-msg-next
+ "[[" 'log-view-msg-prev
+ (kbd "C-j") 'log-view-file-next
+ (kbd "C-k") 'log-view-file-prev))
+
+(provide 'evil-collection-log-view)
+;;; evil-collection-log-view.el ends here
diff --git a/modes/lsp-ui-imenu/evil-collection-lsp-ui-imenu.el b/modes/lsp-ui-imenu/evil-collection-lsp-ui-imenu.el
new file mode 100644
index 0000000..e694506
--- /dev/null
+++ b/modes/lsp-ui-imenu/evil-collection-lsp-ui-imenu.el
@@ -0,0 +1,47 @@
+;;; evil-collection-lsp-ui-imenu.el --- Bindings for `lsp-ui-imenu-mode'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: Felix Dick <felix.dick@web.de>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, lsp-ui-imenu, convenience
+
+;; 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:
+;;; Bindings for `lsp-ui-imenu-mode'.
+
+;;; Code:
+(require 'lsp-ui-imenu nil t)
+(require 'evil-collection)
+
+(defconst evil-collection-lsp-ui-imenu-mode-maps '(lsp-ui-imenu-mode-map))
+
+;;;###autoload
+(defun evil-collection-lsp-ui-imenu-setup ()
+ "Set up `evil' bindings for `lsp-ui-imenu'."
+ (evil-set-initial-state 'lsp-ui-imenu-mode 'normal)
+ (evil-collection-define-key 'normal 'lsp-ui-imenu-mode-map
+ (kbd "C-k") 'lsp-ui-imenu--prev-kind
+ (kbd "C-j") 'lsp-ui-imenu--next-kind
+ (kbd "q") 'lsp-ui-imenu--kill
+ (kbd "RET") 'lsp-ui-imenu--view
+ (kbd "<M-return>") 'lsp-ui-imenu--visit))
+
+(provide 'evil-collection-lsp-ui-imenu)
+;;; evil-collection-lsp-ui-imenu.el ends here
diff --git a/modes/lua-mode/evil-collection-lua-mode.el b/modes/lua-mode/evil-collection-lua-mode.el
new file mode 100644
index 0000000..0541c97
--- /dev/null
+++ b/modes/lua-mode/evil-collection-lua-mode.el
@@ -0,0 +1,50 @@
+;;; evil-collection-lua-mode.el --- Bindings for `lua-mode'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;;; Bindings for `lua-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'lua-mode nil t)
+
+(defvar lua-indent-level)
+(defconst evil-collection-lua-mode-maps '(lua-mode-map))
+
+(defun evil-collection-lua-mode-set-evil-shift-width ()
+ "Set `evil-shift-width' according to `lua-indent-level'."
+ (setq evil-shift-width lua-indent-level))
+
+;;;###autoload
+(defun evil-collection-lua-mode-setup ()
+ "Set up `evil' bindings for `lua-mode'."
+ (add-hook 'lua-mode-hook #'evil-collection-lua-mode-set-evil-shift-width)
+
+ (evil-collection-define-key 'normal 'lua-mode-map
+ "K" 'lua-search-documentation
+ "gz" 'run-lua))
+
+(provide 'evil-collection-lua-mode)
+;;; evil-collection-lua-mode.el ends here
diff --git a/modes/macrostep/evil-collection-macrostep.el b/modes/macrostep/evil-collection-macrostep.el
new file mode 100644
index 0000000..8c819ce
--- /dev/null
+++ b/modes/macrostep/evil-collection-macrostep.el
@@ -0,0 +1,52 @@
+;;; evil-collection-macrostep.el --- Evil Integration for Macrostep -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, macrostep, tools
+
+;; 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:
+;; Evil bindings for `macrostep-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'macrostep nil t)
+
+(defconst evil-collection-macrostep-maps '(macrostep-keymap))
+
+;;;###autoload
+(defun evil-collection-macrostep-setup ()
+ "Set up `evil' bindings for `macrostep'."
+ ;; Keymaps don't seem to be populated on first try.
+ ;; Force `evil' to normalize keymaps.
+ (add-hook 'macrostep-mode-hook #'evil-normalize-keymaps)
+
+ (evil-collection-define-key 'normal 'macrostep-keymap
+ "q" 'macrostep-collapse-all
+ "e" 'macrostep-expand
+ "u" 'macrostep-collapse
+ "gj" 'macrostep-next-macro
+ "gk" 'macrostep-prev-macro
+ (kbd "C-j") 'macrostep-next-macro
+ (kbd "C-k") 'macrostep-prev-macro))
+
+(provide 'evil-collection-macrostep)
+;;; evil-collection-macrostep.el ends here
diff --git a/modes/magit/evil-collection-magit.el b/modes/magit/evil-collection-magit.el
new file mode 100644
index 0000000..8fbed2d
--- /dev/null
+++ b/modes/magit/evil-collection-magit.el
@@ -0,0 +1,51 @@
+;;; evil-collection-magit.el --- Bindings for `magit' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2018 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;;; Bindings for `magit'
+;;; This file is to work around an issue described in
+;;; https://github.com/emacs-evil/evil-collection/issues/108
+;;; Ideally this file is only temporary and should be removed once
+;;; #108 is resolved.
+
+;;; Code:
+(require 'evil-collection)
+(require 'magit nil t)
+
+(defvar magit-blame-mode-map)
+
+(defconst evil-collection-magit-maps '(magit-blame-mode-map
+ magit-blame-read-only-mode-map))
+
+;;;###autoload
+(defun evil-collection-magit-setup ()
+ "Set up `evil' bindings for `magit'."
+ (evil-collection-define-key 'normal 'magit-blame-mode-map
+ "q" 'magit-blame-quit)
+ (evil-collection-define-key 'normal 'magit-blame-read-only-mode-map
+ "q" 'magit-blame-quit))
+
+(provide 'evil-collection-magit)
+;;; evil-collection-magit.el ends here
diff --git a/modes/man/evil-collection-man.el b/modes/man/evil-collection-man.el
new file mode 100644
index 0000000..1797e5e
--- /dev/null
+++ b/modes/man/evil-collection-man.el
@@ -0,0 +1,68 @@
+;;; evil-collection-man.el --- Evil bindings for Man-mode -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, man, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for `man'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'man)
+
+(defconst evil-collection-man-maps '(Man-mode-map))
+
+;;;###autoload
+(defun evil-collection-man-setup ()
+ "Set up `evil' bindings for `man'."
+ (evil-set-initial-state 'Man-mode 'normal)
+ (evil-collection-define-key 'normal 'Man-mode-map
+ ;; motion
+ (kbd "SPC") 'scroll-up-command
+ (kbd "S-SPC") 'scroll-down-command
+ (kbd "<tab>") 'forward-button
+ (kbd "<backtab>") 'backward-button
+
+ (kbd "]]") 'Man-next-manpage
+ (kbd "[[") 'Man-previous-manpage
+ (kbd "gj") 'Man-next-manpage
+ (kbd "gk") 'Man-previous-manpage
+ (kbd "C-j") 'Man-next-section
+ (kbd "C-k") 'Man-previous-section
+
+ ;; goto
+ "gm" 'man
+ "gd" 'Man-goto-section ; TODO: "gd" does not match the rationale of "go to definition". Change?
+ "gR" 'Man-follow-manual-reference ; TODO: Make this match Info-follow-reference?
+ "gs" 'Man-goto-see-also-section
+
+ ;; refresh
+ "gr" 'Man-update-manpage
+
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'quit-window
+ "ZZ" 'quit-window))
+
+(provide 'evil-collection-man)
+;;; evil-collection-man.el ends here
diff --git a/modes/minibuffer/evil-collection-minibuffer.el b/modes/minibuffer/evil-collection-minibuffer.el
new file mode 100644
index 0000000..879c896
--- /dev/null
+++ b/modes/minibuffer/evil-collection-minibuffer.el
@@ -0,0 +1,76 @@
+;;; evil-collection-minibuffer.el --- Evil bindings for the minibuffer -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, minibuffer, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for the minibuffer.
+
+;;; Code:
+(require 'evil-collection)
+
+(defconst evil-collection-minibuffer-maps '(minibuffer-local-map
+ minibuffer-local-ns-map
+ minibuffer-local-completion-map
+ minibuffer-local-must-match-map
+ minibuffer-local-isearch-map
+ evil-ex-completion-map))
+
+(defun evil-collection-minibuffer-insert ()
+ "Switch to insert state.
+
+This function is meant to be hooked in the minibuffer:
+
+ (add-hook 'minibuffer-setup-hook 'evil-collection-minibuffer-insert)
+
+`evil-set-initial-state' can not be used for the minibuffer since
+it does not have a mode."
+ (set (make-local-variable 'evil-echo-state) nil)
+ ;; (evil-set-initial-state 'mode 'insert) is the evil-proper
+ ;; way to do this, but the minibuffer doesn't have a mode.
+ ;; The alternative is to create a minibuffer mode (here), but
+ ;; then it may conflict with other packages' if they do the same.
+ (evil-insert 1))
+
+;;;###autoload
+(defun evil-collection-minibuffer-setup ()
+ "Initialize minibuffer for `evil'."
+ ;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-from-Minibuffer.html
+ (dolist (map '(minibuffer-local-map
+ minibuffer-local-ns-map
+ minibuffer-local-completion-map
+ minibuffer-local-must-match-map
+ minibuffer-local-isearch-map))
+ (evil-collection-define-key 'normal map (kbd "<escape>") 'abort-recursive-edit)
+ (evil-collection-define-key 'normal map (kbd "RET") 'exit-minibuffer))
+
+ (add-hook 'minibuffer-setup-hook 'evil-collection-minibuffer-insert)
+ ;; Because of the above minibuffer-setup-hook, some evil-ex bindings need be reset.
+ (evil-collection-define-key 'normal 'evil-ex-completion-map (kbd "<escape>") 'abort-recursive-edit)
+ (evil-collection-define-key 'insert 'evil-ex-completion-map (kbd "C-p") 'previous-complete-history-element)
+ (evil-collection-define-key 'insert 'evil-ex-completion-map (kbd "C-n") 'next-complete-history-element)
+ (evil-collection-define-key 'normal 'evil-ex-completion-map (kbd "C-p") 'previous-history-element)
+ (evil-collection-define-key 'normal 'evil-ex-completion-map (kbd "C-n") 'next-history-element))
+
+(provide 'evil-collection-minibuffer)
+;;; evil-collection-minibuffer.el ends here
diff --git a/modes/mu4e-conversation/evil-collection-mu4e-conversation.el b/modes/mu4e-conversation/evil-collection-mu4e-conversation.el
new file mode 100644
index 0000000..8d72bc1
--- /dev/null
+++ b/modes/mu4e-conversation/evil-collection-mu4e-conversation.el
@@ -0,0 +1,75 @@
+;;; evil-collection-mu4e-conversation.el --- Evil bindings for mu4e-conversation -*- lexical-binding: t -*-
+
+;; Copyright (C) 2018 Pierre Neidhardt <mail@ambrevar.xyz>
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "24.4") (evil "1.2.10"))
+;; Keywords: evil, mu4e, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for mu4e-conversation.
+
+;;; Code:
+
+(require 'evil-collection)
+(require 'mu4e-conversation nil t)
+
+(defconst evil-collection-mu4e-conversation-maps '(mu4e-conversation-map
+ mu4e-conversation-thread-map))
+
+(defvar evil-collection-mu4e-conversation--local-map-p nil
+ "Non-nil if last position was on a local-map property.")
+
+(defun evil-collection-mu4e-conversation--switch ()
+ "Re-compute the bindings if point has moved between the thread
+ area and the composition area."
+ (let ((local-map-here (get-text-property (point) 'local-map)))
+ (when (or (and evil-collection-mu4e-conversation--local-map-p
+ (not local-map-here))
+ (and (not evil-collection-mu4e-conversation--local-map-p)
+ local-map-here))
+ (evil-normalize-keymaps))
+ (setq evil-collection-mu4e-conversation--local-map-p local-map-here)))
+
+(defun evil-collection-mu4e-conversation--update-local-map ()
+ (setq evil-collection-mu4e-conversation--local-map-p (get-text-property (point) 'local-map))
+ (evil-normalize-keymaps)
+ (add-hook 'post-command-hook 'evil-collection-mu4e-conversation--switch nil t))
+
+;;;###autoload
+(defun evil-collection-mu4e-conversation-setup ()
+ "Set up `evil' bindings for `mu4e-conversation'."
+ ;; Evil does not update its current keymap state when it the point hits a
+ ;; local-map property is used. See
+ ;; https://github.com/emacs-evil/evil/issues/301. Thus we force the update
+ ;; with a technique similar to what `org~mu4e-mime-switch-headers-or-body'
+ ;; does.
+ (add-hook 'mu4e-conversation-hook 'evil-collection-mu4e-conversation--update-local-map)
+ (evil-collection-define-key 'normal 'mu4e-conversation-map
+ " " 'evil-scroll-page-down
+ (kbd "S-SPC") 'evil-scroll-page-up
+ "[[" 'mu4e-conversation-previous-message
+ "]]" 'mu4e-conversation-next-message
+ "zv" 'mu4e-conversation-toggle-view
+ "za" 'mu4e-conversation-toggle-hide-cited
+ "q" 'mu4e-conversation-quit))
+
+(provide 'evil-collection-mu4e-conversation)
+;;; evil-collection-mu4e-conversation.el ends here
diff --git a/modes/mu4e/evil-collection-mu4e.el b/modes/mu4e/evil-collection-mu4e.el
new file mode 100644
index 0000000..756c171
--- /dev/null
+++ b/modes/mu4e/evil-collection-mu4e.el
@@ -0,0 +1,338 @@
+;;; evil-collection-mu4e.el --- Evil bindings for mu4e -*- lexical-binding: t -*-
+
+;; Copyright (C) 2015-2018 Joris Engbers
+;; Copyright (C) 2018 Pierre Neidhardt <mail@ambrevar.xyz>
+
+;; Author: Joris Engbers <info@jorisengbers.nl>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.9
+;; Package-Requires: ((emacs "24.4") (evil "1.2.10"))
+;; Keywords: evil, mu4e, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil keybindings for mu4e that make sense for Evil users. The following
+;; keybindings are defined:
+;;
+;; General commands:
+;; | Commmand | evil-mu4e | Alternative |
+;; |--------------------------+-----------+-------------|
+;; | Jump to maildir | J | |
+;; | Update | u | |
+;; | Compose message | cc | C |
+;; | Kill update mail process | x | |
+
+;; Commands for header-mode and view-mode:
+;; | Command | evil-mu4e | Alternative |
+;; |---------------------------------+-----------+-------------|
+;; | Next message | C-j | |
+;; | Previous message | C-k | |
+;; | Mark the current thread as read | T | |
+;; | Compose message | cc | C |
+;; | Compose edit** | ce | E |
+;; | Compose forward** | cf | F |
+;; | Compose reply | cr | R |
+;; | Change sorting*** | o | O |
+;; | Rerun search | gr | |
+;; | Toggle include related | zr | |
+;; | Toggle threading | zt | |
+;; | Toggle hide cited | za | |
+;; | Skip duplicates | zd | |
+;; | Show log | gl | |
+;; | Select other view | gv | |
+;; | Save attachement(s) | p | P |
+;; | Save url | yu | |
+;; | Go to url | gx | |
+;; | Fetch url | gX | |
+;;
+;; - * denotes only in header-mode
+;; - ** denotes Alternative only in header-mode
+;; - *** denotes Alternative only in view-mode
+;;
+;;; Code:
+
+(require 'evil-collection)
+(require 'mu4e nil t)
+
+(declare-function mu4e~main-action-str "mu4e-main")
+(declare-function mu4e~main-view-queue "mu4e-main")
+(defvar smtpmail-send-queued-mail)
+(defvar smtpmail-queue-dir)
+
+(defconst evil-collection-mu4e-maps '(mu4e-main-mode-map
+ mu4e-headers-mode-map
+ mu4e-view-mode-map
+ mu4e-compose-mode-map))
+
+
+
+(defun evil-collection-mu4e-set-state ()
+ "Set the appropriate initial state of all mu4e modes."
+ (dolist (mode '(mu4e-main-mode
+ mu4e-headers-mode
+ mu4e-view-mode
+ mu4e-org-mode))
+ (evil-set-initial-state mode 'normal))
+ (evil-set-initial-state 'mu4e-compose-mode 'insert))
+
+
+
+;;; Define bindings
+
+;; TODO: Inhibit insert-state functions as per Evil Collection.
+(defvar evil-collection-mu4e-mode-map-bindings
+ `((mu4e-main-mode-map
+ "J" mu4e~headers-jump-to-maildir
+ "j" next-line
+ "k" previous-line
+ "u" mu4e-update-mail-and-index
+ "gr" revert-buffer
+ "b" mu4e-headers-search-bookmark
+ "B" mu4e-headers-search-bookmark-edit
+ "N" mu4e-news
+ ";" mu4e-context-switch
+ "H" mu4e-display-manual
+ "C" mu4e-compose-new
+ "cc" mu4e-compose-new
+ "x" mu4e-kill-update-mail
+ "A" mu4e-about
+ "f" smtpmail-send-queued-mail
+ "m" mu4e~main-toggle-mail-sending-mode
+ "s" mu4e-headers-search
+ "q" mu4e-quit)
+
+ (mu4e-headers-mode-map
+ "q" mu4e~headers-quit-buffer
+ "J" mu4e~headers-jump-to-maildir
+ "C" mu4e-compose-new
+ "E" mu4e-compose-edit
+ "F" mu4e-compose-forward
+ "R" mu4e-compose-reply
+ "cc" mu4e-compose-new
+ "ce" mu4e-compose-edit
+ "cf" mu4e-compose-forward
+ "cr" mu4e-compose-reply
+ "o" mu4e-headers-change-sorting
+ "j" mu4e-headers-next
+ "k" mu4e-headers-prev
+ "gr" mu4e-headers-rerun-search
+ "b" mu4e-headers-search-bookmark
+ "B" mu4e-headers-search-bookmark-edit
+ ";" mu4e-context-switch
+ ,(kbd "RET") mu4e-headers-view-message
+ "/" mu4e-headers-search-narrow
+ "s" mu4e-headers-search
+ "S" mu4e-headers-search-edit
+ "x" mu4e-mark-execute-all
+ "a" mu4e-headers-action
+ "*" mu4e-headers-mark-for-something ; TODO: Don't override evil-seach-word-forward?
+ "&" mu4e-headers-mark-custom
+ "A" mu4e-headers-mark-for-action
+ "m" mu4e-headers-mark-for-move
+ "r" mu4e-headers-mark-for-refile
+ "D" mu4e-headers-mark-for-delete
+ "d" mu4e-headers-mark-for-trash
+ "=" mu4e-headers-mark-for-untrash
+ "u" mu4e-headers-mark-for-unmark
+ "U" mu4e-mark-unmark-all
+ "?" mu4e-headers-mark-for-unread
+ "!" mu4e-headers-mark-for-read
+ "%" mu4e-headers-mark-pattern
+ "+" mu4e-headers-mark-for-flag
+ "-" mu4e-headers-mark-for-unflag
+ "[[" mu4e-headers-prev-unread
+ "]]" mu4e-headers-next-unread
+ "gk" mu4e-headers-prev-unread
+ "gj" mu4e-headers-next-unread
+ "\C-j" mu4e-headers-next
+ "\C-k" mu4e-headers-prev
+ "zr" mu4e-headers-toggle-include-related
+ "zt" mu4e-headers-toggle-threading
+ "zd" mu4e-headers-toggle-skip-duplicates
+ "gl" mu4e-show-log
+ "gv" mu4e-select-other-view
+ "T" (lambda ()
+ (interactive)
+ (mu4e-headers-mark-thread nil '(read))))
+
+ (mu4e-compose-mode-map
+ "gg" mu4e-compose-goto-top
+ "G" mu4e-compose-goto-bottom)
+
+ (mu4e-view-mode-map
+ " " mu4e-view-scroll-up-or-next
+ [tab] shr-next-link
+ [backtab] shr-previous-link
+ "q" mu4e~view-quit-buffer
+ "gx" mu4e-view-go-to-url
+ "gX" mu4e-view-fetch-url
+ "C" mu4e-compose-new
+ "H" mu4e-view-toggle-html
+ ;; "E" mu4e-compose-edit
+ ;; "F" mu4e-compose-forward
+ "R" mu4e-compose-reply
+ "cc" mu4e-compose-new
+ "ce" mu4e-compose-edit
+ "cf" mu4e-compose-forward
+ "cr" mu4e-compose-reply
+ "p" mu4e-view-save-attachment
+ "P" mu4e-view-save-attachment-multi ; Since mu4e 1.0, -multi is same as normal.
+ "O" mu4e-headers-change-sorting
+ "o" mu4e-view-open-attachment
+ "A" mu4e-view-attachment-action
+ "a" mu4e-view-action
+ "J" mu4e~headers-jump-to-maildir
+ "[[" mu4e-view-headers-prev-unread
+ "]]" mu4e-view-headers-next-unread
+ "gk" mu4e-view-headers-prev-unread
+ "gj" mu4e-view-headers-next-unread
+ "\C-j" mu4e-view-headers-next
+ "\C-k" mu4e-view-headers-prev
+ "x" mu4e-view-marked-execute
+ "&" mu4e-view-mark-custom
+ "*" mu4e-view-mark-for-something ; TODO: Don't override "*".
+ "m" mu4e-view-mark-for-move
+ "r" mu4e-view-mark-for-refile
+ "D" mu4e-view-mark-for-delete
+ "d" mu4e-view-mark-for-trash
+ "=" mu4e-view-mark-for-untrash
+ "u" mu4e-view-unmark
+ "U" mu4e-view-unmark-all
+ "?" mu4e-view-mark-for-unread
+ "!" mu4e-view-mark-for-read
+ "%" mu4e-view-mark-pattern
+ "+" mu4e-view-mark-for-flag
+ "-" mu4e-view-mark-for-unflag
+ "zr" mu4e-headers-toggle-include-related
+ "zt" mu4e-headers-toggle-threading
+ "za" mu4e-view-toggle-hide-cited
+ "gl" mu4e-show-log
+ "s" mu4e-view-search-edit
+ "|" mu4e-view-pipe
+ "." mu4e-view-raw-message
+ ,(kbd "C--") mu4e-headers-split-view-shrink
+ ,(kbd "C-+") mu4e-headers-split-view-grow
+ "T" (lambda ()
+ (interactive)
+ (mu4e-headers-mark-thread nil '(read)))
+ ,@(when evil-want-C-u-scroll
+ '("\C-u" evil-scroll-up))))
+ ;; TODO: Add mu4e-headers-search-bookmark?
+ "All evil-mu4e bindings.")
+
+(defun evil-collection-mu4e-set-bindings ()
+ "Set the bindings."
+ ;; WARNING: With lexical binding, lambdas from `mapc' and `dolist' become
+ ;; closures in which we must use `evil-define-key*' instead of
+ ;; `evil-define-key'.
+ (dolist (binding evil-collection-mu4e-mode-map-bindings)
+ (apply #'evil-collection-define-key 'normal binding))
+ (evil-collection-define-key 'visual 'mu4e-compose-mode-map
+ "gg" 'mu4e-compose-goto-top
+ "G" 'mu4e-compose-goto-bottom)
+ (evil-set-command-property 'mu4e-compose-goto-bottom :keep-visual t)
+ (evil-set-command-property 'mu4e-compose-goto-top :keep-visual t)
+ (evil-collection-define-key 'operator 'mu4e-view-mode-map
+ "u" '(menu-item
+ ""
+ nil
+ :filter (lambda (&optional _)
+ (when (memq evil-this-operator
+ '(evil-yank evil-cp-yank evil-sp-yank lispyville-yank))
+ (setq evil-inhibit-operator t)
+ #'mu4e-view-save-url)))))
+
+
+;;; Update mu4e-main-view
+;;; To avoid confusion the main-view is updated to show the keys that are in use
+;;; for evil-mu4e.
+
+(defvar evil-collection-mu4e-begin-region-basic "\n Basics"
+ "The place where to start overriding Basic section.")
+
+(defvar evil-collection-mu4e-end-region-basic "a new message\n"
+ "The place where to end overriding Basic section.")
+
+(defvar evil-collection-mu4e-new-region-basic
+ (concat (mu4e~main-action-str "\t* [J]ump to some maildir\n" 'mu4e-jump-to-maildir)
+ (mu4e~main-action-str "\t* enter a [s]earch query\n" 'mu4e-search)
+ (mu4e~main-action-str "\t* [C]ompose a new message\n" 'mu4e-compose-new))
+ "Define the evil-mu4e Basic region.")
+
+(defvar evil-collection-mu4e-begin-region-misc "\n Misc"
+ "The place where to start overriding Misc section.")
+
+(defvar evil-collection-mu4e-end-region-misc "q]uit"
+ "The place where to end overriding Misc section.")
+
+(defun evil-collection-mu4e-new-region-misc ()
+ "Define the evil-mu4e Misc region."
+ (concat
+ (mu4e~main-action-str "\t* [;]Switch focus\n" 'mu4e-context-switch)
+ (mu4e~main-action-str "\t* [u]pdate email & database (Alternatively: gr)\n"
+ 'mu4e-update-mail-and-index)
+
+ ;; show the queue functions if `smtpmail-queue-dir' is defined
+ (if (file-directory-p smtpmail-queue-dir)
+ (mu4e~main-view-queue)
+ "")
+ "\n"
+
+ (mu4e~main-action-str "\t* [N]ews\n" 'mu4e-news)
+ (mu4e~main-action-str "\t* [A]bout mu4e\n" 'mu4e-about)
+ (mu4e~main-action-str "\t* [H]elp\n" 'mu4e-display-manual)
+ (mu4e~main-action-str "\t* [q]uit\n" 'mu4e-quit)))
+
+(defun evil-collection-mu4e-replace-region (new-region start end)
+ "Replace region between START and END with NEW-REGION.
+START end END end are regular expressions."
+ ;; move to start of region
+ (goto-char (point-min))
+ (re-search-forward start)
+
+ ;; insert new headings
+ (insert "\n\n")
+ (insert new-region)
+ ;; Delete text until end of region.
+ (let ((start-point (point))
+ (end-point (re-search-forward end)))
+ (delete-region start-point end-point)))
+
+(defun evil-collection-mu4e-update-main-view ()
+ "Update 'Basic' and 'Misc' regions to reflect the new
+keybindings."
+ (evil-collection-mu4e-replace-region evil-collection-mu4e-new-region-basic
+ evil-collection-mu4e-begin-region-basic
+ evil-collection-mu4e-end-region-basic)
+ (evil-collection-mu4e-replace-region (evil-collection-mu4e-new-region-misc)
+ evil-collection-mu4e-begin-region-misc
+ evil-collection-mu4e-end-region-misc))
+
+
+;;; Initialize evil-collection-mu4e
+
+;;;###autoload
+(defun evil-collection-mu4e-setup ()
+ "Initialize evil-mu4e if necessary.
+If mu4e-main-mode is in evil-state-motion-modes, initialization
+is already done earlier."
+ (evil-collection-mu4e-set-state)
+ (evil-collection-mu4e-set-bindings)
+ (add-hook 'mu4e-main-mode-hook 'evil-collection-mu4e-update-main-view))
+
+(provide 'evil-collection-mu4e)
+;;; evil-collection-mu4e.el ends here
diff --git a/modes/neotree/evil-collection-neotree.el b/modes/neotree/evil-collection-neotree.el
new file mode 100644
index 0000000..911a7e2
--- /dev/null
+++ b/modes/neotree/evil-collection-neotree.el
@@ -0,0 +1,101 @@
+;;; evil-collection-neotree.el --- Evil bindings for neotree -*- lexical-binding: t; no-byte-compile: t; -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Maximiliano Sandoval <msandova@protonmail.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, neotree, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for `neotree'
+
+;;; Code:
+
+(require 'evil-collection)
+(require 'neotree nil t)
+
+(declare-function neotree-make-executor "neotree.el")
+(defconst evil-collection-neotree-maps '(neotree-mode-map))
+
+;;;###autoload
+(defun evil-collection-neotree-setup ()
+ "Set up `evil' bindings for `neotree'."
+
+ (evil-set-initial-state 'neotree-mode 'normal) ;; Neotree start in normal by default.
+
+ (evil-collection-define-key 'normal 'neotree-mode-map
+
+ (kbd "RET") (neotree-make-executor
+ :file-fn 'neo-open-file
+ :dir-fn 'neo-open-dir)
+ (kbd "<tab>") (neotree-make-executor
+ :dir-fn 'neo-open-dir)
+ "z" (neotree-make-executor
+ :dir-fn 'neo-open-dir)
+ "ZZ" 'quit-window
+ "gd" (neotree-make-executor
+ :dir-fn 'neo-open-dired)
+ "gD" (neotree-make-executor
+ :dir-fn 'neo-open-dired)
+ "go" (neotree-make-executor
+ :file-fn 'neo-open-file
+ :dir-fn 'neo-open-dir)
+ "gO" 'neotree-quick-look
+ "gr" 'neotree-refresh
+ "q" 'neotree-hide
+ "H" 'neotree-hidden-file-toggle
+ "gh" 'neotree-hidden-file-toggle
+ (kbd "C-k") 'neotree-select-up-node
+ "gk" 'neotree-select-up-node
+ "[[" 'neotree-select-up-node
+ (kbd "C-j") 'neotree-select-down-node
+ "gj" 'neotree-select-down-node
+ "]]" 'neotree-select-down-node
+ "gv" 'neotree-open-file-in-system-application
+ "c" 'neotree-create-node
+ "y" 'neotree-copy-node
+ "r" 'neotree-rename-node
+ "R" 'neotree-change-root
+ "d" 'neotree-delete-node
+ "J" 'neotree-dir
+ "+" 'neotree-stretch-toggle
+ "=" 'neotree-stretch-toggle
+ "ge" 'neotree-enter
+ "j" 'neotree-next-line
+ "k" 'neotree-previous-line
+
+ ;; Unchanged keybings.
+ "a" (neotree-make-executor
+ :file-fn 'neo-open-file-ace-window)
+ "|" (neotree-make-executor
+ :file-fn 'neo-open-file-vertical-split)
+ "-" (neotree-make-executor
+ :file-fn 'neo-open-file-horizontal-split)
+ "S" 'neotree-select-previous-sibling-node
+ "s" 'neotree-select-next-sibling-node
+ (kbd "C-c C-c") 'neotree-change-root
+ (kbd "C-x 1") 'neotree-empty-fn
+ (kbd "C-x 2") 'neotree-empty-fn
+ (kbd "C-x 3") 'neotree-empty-fn
+ (kbd "C-x C-f") 'find-file-other-window
+ (kbd "C-c C-f") 'find-file-other-window))
+
+(provide 'evil-collection-neotree)
+;;; evil-collection-neotree.el ends here
diff --git a/modes/notmuch/evil-collection-notmuch.el b/modes/notmuch/evil-collection-notmuch.el
new file mode 100644
index 0000000..9880a23
--- /dev/null
+++ b/modes/notmuch/evil-collection-notmuch.el
@@ -0,0 +1,250 @@
+;;; evil-collection-notmuch.el --- Bindings for `notmuch'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: emacs, tools, evil
+
+;; 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:
+;;; Bindings for `notmuch'.
+
+;;; Code:
+(require 'notmuch nil t)
+(require 'evil-collection)
+
+(declare-function notmuch-show-get-tags "notmuch-show")
+(declare-function notmuch-show-tag "notmuch-show")
+(declare-function notmuch-search-get-tags "notmuch")
+(declare-function notmuch-search-tag "notmuch")
+(declare-function notmuch-tree-tag "notmuch-tree")
+
+(declare-function notmuch-tree-close-message-pane-and "notmuch-tree")
+
+(defconst evil-collection-notmuch-maps '(notmuch-common-keymap
+ notmuch-hello-mode-map
+ notmuch-show-mode-map
+ notmuch-show-part-map
+ notmuch-tree-mode-map
+ notmuch-search-mode-map
+ notmuch-search-stash-map))
+
+(defun evil-collection-notmuch-toggle-tag (tag mode &optional next-function)
+ "Toggle TAG tag for message in MODE."
+ (let ((get (intern (format "notmuch-%s-get-tags" mode)))
+ (set (intern (format "notmuch-%s-tag" mode)))
+ (next (or next-function (intern (format "notmuch-%s-next-message" mode)))))
+ (funcall set (list (concat (if (member tag (funcall get))
+ "-" "+")
+ tag)))
+ (funcall next)))
+
+(defun evil-collection-notmuch-show-toggle-delete ()
+ "Toggle deleted tag for message."
+ (interactive)
+ (evil-collection-notmuch-toggle-tag "deleted" "show"))
+
+(defun evil-collection-notmuch-tree-toggle-delete ()
+ "Toggle deleted tag for message."
+ (interactive)
+ (evil-collection-notmuch-toggle-tag "deleted" "tree"))
+
+(defun evil-collection-notmuch-search-toggle-delete ()
+ "Toggle deleted tag for message."
+ (interactive)
+ (evil-collection-notmuch-toggle-tag "deleted" "search" 'notmuch-search-next-thread))
+
+(defun evil-collection-notmuch-tree-toggle-unread ()
+ "Toggle unread tag for message."
+ (interactive)
+ (evil-collection-notmuch-toggle-tag "unread" "tree"))
+
+(defun evil-collection-notmuch-search-toggle-unread ()
+ "Toggle unread tag for message."
+ (interactive)
+ (evil-collection-notmuch-toggle-tag "unread" "search" 'notmuch-search-next-thread))
+
+(defun evil-collection-notmuch-show-toggle-flagged ()
+ "Toggle flagged tag for message."
+ (interactive)
+ (evil-collection-notmuch-toggle-tag "flagged" "show"))
+
+(defun evil-collection-notmuch-tree-toggle-flagged ()
+ "Toggle flagged tag for message."
+ (interactive)
+ (evil-collection-notmuch-toggle-tag "flagged" "tree"))
+
+(defun evil-collection-notmuch-search-toggle-flagged ()
+ "Toggle flagged tag for message."
+ (interactive)
+ (evil-collection-notmuch-toggle-tag "flagged" "search" 'notmuch-search-next-thread))
+
+(defun evil-collection-notmuch-hello-ret ()
+ (interactive)
+ (evil-execute-in-emacs-state)
+ (call-interactively (key-binding (kbd "RET"))))
+
+;;;###autoload
+(defun evil-collection-notmuch-setup ()
+ "Set up `evil' bindings for `notmuch'."
+ (evil-collection-inhibit-insert-state 'notmuch-show-mode-map)
+ (evil-collection-inhibit-insert-state 'notmuch-search-mode-map)
+ (evil-collection-inhibit-insert-state 'notmuch-tree-mode-map)
+
+ (evil-set-initial-state 'notmuch-show-mode 'normal)
+ (evil-set-initial-state 'notmuch-search-mode 'normal)
+ (evil-set-initial-state 'notmuch-hello-mode 'normal)
+ (evil-set-initial-state 'notmuch-tree-mode 'normal)
+
+ (evil-collection-define-key 'normal 'notmuch-common-keymap
+ "g?" 'notmuch-help
+ "q" 'notmuch-bury-or-kill-this-buffer
+ "s" 'notmuch-search
+ "S" 'notmuch-tree
+ "C" 'notmuch-mua-new-mail ; like mu4e
+ "cc" 'notmuch-mua-new-mail ; like mu4e
+ "gr" 'notmuch-refresh-this-buffer
+ "gA" 'notmuch-refresh-all-buffers
+ "gR" 'notmuch-poll-and-refresh-this-buffer
+ "J" 'notmuch-jump-search)
+
+ (evil-collection-define-key 'normal 'notmuch-hello-mode-map
+ "g?" 'notmuch-hello-versions
+ (kbd "TAB") 'widget-forward
+ (kbd "RET") 'evil-collection-notmuch-hello-ret
+ (kbd "S-TAB") 'widget-backward
+ (kbd "<C-tab>") 'widget-backward)
+
+ (evil-collection-define-key 'normal 'notmuch-show-mode-map
+ "gd" 'goto-address-at-point
+ "p" 'notmuch-show-save-attachments ; like mu4e
+ "A" 'notmuch-show-archive-thread-then-next
+ "S" 'notmuch-show-filter-thread
+ "K" 'notmuch-tag-jump
+ "C" 'notmuch-mua-new-mail ; like mu4e
+ "cc" 'notmuch-mua-new-mail ; like mu4e
+ "cR" 'notmuch-show-reply
+ "cf" 'notmuch-show-forward-message
+ "X" 'notmuch-show-archive-thread-then-exit
+ "zv" 'notmuch-tree-from-show-current-query ; like mu4e-conversation
+ "<" 'notmuch-show-toggle-thread-indentation
+ "a" 'notmuch-show-archive-message-then-next-or-next-thread
+ "d" 'evil-collection-notmuch-show-toggle-delete
+ "=" 'evil-collection-notmuch-show-toggle-flagged
+ "H" 'notmuch-show-toggle-visibility-headers
+ "gj" 'notmuch-show-next-open-message
+ "gk" 'notmuch-show-previous-open-message
+ "]]" 'notmuch-show-next-message
+ "[[" 'notmuch-show-previous-message
+ (kbd "C-j") 'notmuch-show-next-message
+ (kbd "C-k") 'notmuch-show-previous-message
+ (kbd "M-j") 'notmuch-show-next-thread-show
+ (kbd "M-k") 'notmuch-show-previous-thread-show
+ "cr" 'notmuch-show-reply-sender
+ (kbd "x") 'notmuch-show-archive-message-then-next-or-exit
+ "|" 'notmuch-show-pipe-message
+ "*" 'notmuch-show-tag-all
+ "-" 'notmuch-show-remove-tag
+ "+" 'notmuch-show-add-tag
+ (kbd "TAB") 'notmuch-show-next-button
+ (kbd "<backtab>") 'notmuch-show-previous-button
+ (kbd "RET") 'notmuch-show-toggle-message
+ "." 'notmuch-show-part-map)
+
+ (evil-collection-define-key 'normal 'notmuch-tree-mode-map
+ "g?" (notmuch-tree-close-message-pane-and 'notmuch-help)
+ "q" 'notmuch-tree-quit
+ "S" 'notmuch-tree-to-search
+ "C" (notmuch-tree-close-message-pane-and 'notmuch-mua-new-mail) ; like mu4e
+ "cc" (notmuch-tree-close-message-pane-and 'notmuch-mua-new-mail) ; like mu4e
+ "J" (notmuch-tree-close-message-pane-and 'notmuch-jump-search)
+ "zv" 'notmuch-search-from-tree-current-query ; like mu4e-conversation
+ "cr" (notmuch-tree-close-message-pane-and 'notmuch-show-reply-sender) ; like mu4e
+ "cR" (notmuch-tree-close-message-pane-and 'notmuch-show-reply)
+ "d" 'evil-collection-notmuch-tree-toggle-delete
+ "!" 'evil-collection-notmuch-tree-toggle-unread
+ "=" 'evil-collection-notmuch-tree-toggle-flagged
+ "K" 'notmuch-tag-jump
+ (kbd "RET") 'notmuch-tree-show-message
+ [mouse-1] 'notmuch-tree-show-message
+ "A" 'notmuch-tree-archive-thread
+ "a" 'notmuch-tree-archive-message-then-next
+ "s" 'notmuch-tree-to-tree
+ "gj" 'notmuch-tree-next-matching-message
+ "gk" 'notmuch-tree-prev-matching-message
+ "]]" 'notmuch-tree-next-message
+ "[[" 'notmuch-tree-prev-message
+ (kbd "C-k") 'notmuch-tree-prev-thread
+ (kbd "C-j") 'notmuch-tree-next-thread
+ "|" 'notmuch-show-pipe-message
+ "-" 'notmuch-tree-remove-tag
+ "+" 'notmuch-tree-add-tag
+ "*" 'notmuch-tree-tag-thread
+ "e" 'notmuch-tree-resume-message)
+
+ (dolist (state '(normal visual))
+ (evil-collection-define-key state 'notmuch-search-mode-map
+ "cC" 'compose-mail-other-frame
+ "J" 'notmuch-jump-search
+ "S" 'notmuch-search-filter
+ "K" 'notmuch-tag-jump
+ "o" 'notmuch-search-toggle-order
+ "zv" 'notmuch-tree-from-search-current-query
+ "*" 'notmuch-search-tag-all
+ "a" 'notmuch-search-archive-thread
+ "cc" 'compose-mail ; like mu4e
+ "d" 'evil-collection-notmuch-search-toggle-delete
+ "!" 'evil-collection-notmuch-search-toggle-unread
+ "=" 'evil-collection-notmuch-search-toggle-flagged
+ "q" 'notmuch-bury-or-kill-this-buffer
+ "cr" 'notmuch-search-reply-to-thread-sender
+ "cR" 'notmuch-search-reply-to-thread
+ "t" 'notmuch-search-filter-by-tag
+ [mouse-1] 'notmuch-search-show-thread
+ "-" 'notmuch-search-remove-tag
+ "+" 'notmuch-search-add-tag
+ (kbd "RET") 'notmuch-search-show-thread))
+
+ (evil-collection-define-key 'operator 'notmuch-search-mode-map
+ ;; Like `eww'.
+ "s"
+ `(menu-item
+ ""
+ nil
+ :filter (lambda (&optional _)
+ (when (memq evil-this-operator
+ evil-collection-yank-operators)
+ (setq evil-inhibit-operator t)
+ #'notmuch-search-stash-map))))
+
+ (evil-collection-define-key 'operator 'notmuch-show-mode-map
+ ;; Like `eww'.
+ "s"
+ `(menu-item
+ ""
+ nil
+ :filter (lambda (&optional _)
+ (when (memq evil-this-operator
+ evil-collection-yank-operators)
+ (setq evil-inhibit-operator t)
+ #'notmuch-show-stash-map)))))
+
+(provide 'evil-collection-notmuch)
+;;; evil-collection-notmuch.el ends here
diff --git a/modes/nov/evil-collection-nov.el b/modes/nov/evil-collection-nov.el
new file mode 100644
index 0000000..c4f649a
--- /dev/null
+++ b/modes/nov/evil-collection-nov.el
@@ -0,0 +1,67 @@
+;;; evil-collection-nov.el --- Bindings for `nov'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools, epub
+
+;; 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:
+;;; Bindings for`nov'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'nov nil t)
+
+(defvar nov-mode-map)
+
+(defconst evil-collection-nov-maps '(nov-mode-map))
+
+;;;###autoload
+(defun evil-collection-nov-setup ()
+ "Set up `evil' bindings for `nov'."
+ (evil-collection-define-key 'normal 'nov-mode-map
+ "gr" 'nov-render-document
+ "s" 'nov-view-source
+ "S" 'nov-view-content-source
+ "g?" 'nov-display-metadata
+ "gj" 'nov-next-document
+ (kbd "C-j") 'nov-next-document
+ (kbd "M-j") 'nov-next-document
+ "]]" 'nov-next-document
+ "gk" 'nov-previous-document
+ (kbd "C-k") 'nov-previous-document
+ (kbd "M-k") 'nov-previous-document
+ "[[" 'nov-previous-document
+
+ "t" 'nov-goto-toc
+ "i" 'nov-goto-toc
+ (kbd "RET") 'nov-browse-url
+ (kbd "<follow-link>") 'mouse-face
+ (kbd "<mouse-2>") 'nov-browse-url
+ (kbd "TAB") 'shr-next-link
+ (kbd "M-TAB") 'shr-previous-link
+ (kbd "<backtab>") 'shr-previous-link
+ (kbd "SPC") 'nov-scroll-up
+ (kbd "S-SPC") 'nov-scroll-down
+ (kbd "DEL") 'nov-scroll-down))
+
+(provide 'evil-collection-nov)
+;;; evil-collection-nov.el ends here
diff --git a/modes/occur/evil-collection-occur.el b/modes/occur/evil-collection-occur.el
new file mode 100644
index 0000000..dc04827
--- /dev/null
+++ b/modes/occur/evil-collection-occur.el
@@ -0,0 +1,74 @@
+;;; evil-collection-occur.el --- Evil bindings for occur -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, occur, tools
+
+;; 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:
+;; Evil bindings for `occur'.
+
+;;; Code:
+(require 'evil-collection)
+
+(when (> emacs-major-version 25)
+ (require 'replace))
+
+(defconst evil-collection-occur-maps '(occur-mode-map
+ occur-edit-mode-map))
+
+;;;###autoload
+(defun evil-collection-occur-setup ()
+ "Set up `evil' bindings for `occur'."
+ (evil-set-initial-state 'occur-mode 'normal)
+
+ (evil-collection-define-key 'normal 'occur-mode-map
+ ;; Like `wdired-mode'.
+ (kbd "C-x C-q") 'occur-edit-mode
+
+ [mouse-2] 'occur-mode-mouse-goto
+ (kbd "C-c C-c") 'occur-mode-goto-occurrence
+
+ ;; open
+ (kbd "RET") 'occur-mode-goto-occurrence
+ (kbd "S-<return>") 'occur-mode-goto-occurrence-other-window
+ (kbd "M-<return>") 'occur-mode-display-occurrence
+ "go" 'occur-mode-goto-occurrence-other-window
+
+ "gj" 'occur-next
+ "gk" 'occur-prev
+ (kbd "C-j") 'occur-next
+ (kbd "C-k") 'occur-prev
+ "r" 'occur-rename-buffer
+ "c" 'clone-buffer
+ (kbd "C-c C-f") 'next-error-follow-minor-mode)
+
+ (evil-collection-define-key 'normal 'occur-edit-mode-map
+ ;; Like `wdired-mode'.
+ (kbd "C-x C-q") 'occur-cease-edit
+
+ [mouse-2] 'occur-mode-mouse-goto
+ (kbd "C-c C-c") 'occur-cease-edit
+ (kbd "C-o") 'occur-mode-display-occurrence
+ (kbd "C-c C-f") 'next-error-follow-minor-mode))
+
+(provide 'evil-collection-occur)
+;;; evil-collection-occur.el ends here
diff --git a/modes/outline/evil-collection-outline.el b/modes/outline/evil-collection-outline.el
new file mode 100644
index 0000000..4829c70
--- /dev/null
+++ b/modes/outline/evil-collection-outline.el
@@ -0,0 +1,98 @@
+;;; evil-collection-outline.el --- Evil bindings for outline-mode -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, outline, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for outline-mode.
+
+;;; Code:
+(require 'evil-collection)
+(require 'outline)
+
+(defcustom evil-collection-outline-bind-tab-p t
+ "Enable <tab>-based bindings in Outline mode.
+
+Unless you have Evil bindings set up for Org mode, Org will
+inherit the <tab>-based bindings from Outline. Set this option
+to nil if you want to preserve the Emacs-state <tab> keys in Org
+mode."
+ :group 'evil-collection-outline
+ :type 'boolean)
+
+(defconst evil-collection-outline-maps '(outline-mode-map))
+
+;;;###autoload
+(defun evil-collection-outline-setup ()
+ "Set up `evil' bindings for `outline'."
+ (evil-set-initial-state 'outline-mode 'normal)
+ (when evil-collection-outline-bind-tab-p
+ (evil-collection-define-key 'normal 'outline-mode-map
+ (kbd "<backtab>") 'outline-show-all ; Also "z r" by default
+ (kbd "<tab>") 'outline-toggle-children)) ; Also "z a" by default
+ (evil-collection-define-key 'normal 'outline-mode-map
+ ;; folding
+ ;; Evil default keys:
+ ;; zO: Show recursively for current branch only.
+ ;; za: Toggle first level like outline-toggle-children.
+ ;; zc: Hide complete subtree.
+ ;; zm: Show only root notes.
+ ;; zo: Show current node like "za".
+ ;; zr: Show everything.
+ ;; "ze" 'outline-hide-entry
+ ;; "zE" 'outline-show-entry
+ ;; "zl" 'outline-hide-leaves
+ ;; "zb" 'outline-show-branches
+ ;; "zo" 'outline-hide-other
+ "zB" 'outline-hide-body ; Hide all bodies, Emacs has "C-c C-t".
+ "zb" 'outline-hide-entry ; Hide current body, Emacs has "C-c C-c".
+ "ze" 'outline-show-entry ; Show current body only, not subtree, reverse of outline-hide-entry, Emacs has "C-c C-e".
+ "zl" 'outline-hide-leaves ; Like `outline-hide-body' but for current subtree only, Emacs has "C-c C-l".
+ "zK" 'outline-show-branches ; Show all children recursively but no body. Emacs has "C-c C-k".
+ "zk" 'outline-show-children ; Direct children only unlike `outline-show-branches', and no content unlike `outline-show-entry' and `outline-toggle-children'. Emacs has "C-c TAB".
+ "zu" 'outline-up-heading
+
+ "zp" 'outline-hide-other ; Hide all nodes and bodies except current body. Emacs has "C-c C-o".
+ ;; outline-hide-sublevels ; q ; Is it any different from `outline-hide-body'?
+ ;; outline-hide-subtree ; Emacs has "C-c C-d", Evil has default "zc".
+ ;; outline-show-subtree ; Emacs has "C-c C-s", Evil has default "zO".
+
+ ;; TODO: To mark subtree ("C-c @"), we would need to define a tree object.
+
+ ;; motion
+ "[[" 'outline-previous-visible-heading
+ "]]" 'outline-next-visible-heading
+ (kbd "C-k") 'outline-backward-same-level
+ (kbd "C-j") 'outline-forward-same-level
+ "gk" 'outline-backward-same-level
+ "gj" 'outline-forward-same-level
+
+ (kbd "M-h") 'outline-promote ; Org-mode has "M-<left>", Evil-org has "M-h"
+ (kbd "M-j") 'outline-move-subtree-down ; Org-mode has "M-<down>", Evil-org has "M-j"
+ (kbd "M-k") 'outline-move-subtree-up ; Org-mode has "M-<up>", Evil-org has "M-k"
+ (kbd "M-l") 'outline-demote ; Org-mode has "M-<right>", Evil-org has "M-l"
+
+ (kbd "M-<return>") 'outline-insert-heading)) ; Org-mode has "M-<return>"
+
+(provide 'evil-collection-outline)
+;;; evil-collection-outline.el ends here
diff --git a/modes/p4/evil-collection-p4.el b/modes/p4/evil-collection-p4.el
new file mode 100644
index 0000000..8b53bf7
--- /dev/null
+++ b/modes/p4/evil-collection-p4.el
@@ -0,0 +1,123 @@
+;;; evil-collection-p4.el --- Evil bindings for P4 -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, p4, tools
+
+;; 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:
+;; Evil bindings for P4.
+
+;;; Code:
+(require 'p4 nil t)
+(require 'evil-collection)
+
+(defvar p4-basic-mode-map)
+(defvar p4-basic-list-mode-map)
+(defvar p4-opened-list-mode-map)
+(defvar p4-status-list-mode-map)
+(defvar p4-filelog-mode-map)
+(defvar p4-diff-mode-map)
+(defvar p4-annotate-mode-map)
+
+(defconst evil-collection-p4-maps '(p4-basic-mode-map
+ p4-basic-list-mode-map
+ p4-opened-list-mode-map
+ p4-status-list-mode-map
+ p4-filelog-mode-map
+ p4-diff-mode-map
+ p4-annotate-mode-map))
+
+;;;###autoload
+(defun evil-collection-p4-setup ()
+ "Set up `evil' bindings for `p4'."
+ (evil-set-initial-state 'p4-basic-mode 'normal)
+ (evil-set-initial-state 'p4-basic-list-mode 'normal)
+ (evil-set-initial-state 'p4-opened-list-mode-map 'normal)
+ (evil-set-initial-state 'p4-status-list-mode-map 'normal)
+ (evil-set-initial-state 'p4-filelog-mode-map 'normal)
+ (evil-set-initial-state 'p4-diff-mode-map 'normal)
+ (evil-set-initial-state 'p4-annotate-mode-map 'normal)
+
+ (evil-collection-define-key 'normal 'p4-basic-mode-map
+ [mouse-1] 'p4-buffer-mouse-clicked
+ "k" 'evil-previous-line
+ "j" 'evil-next-line
+ (kbd "C-j") 'p4-forward-active-link
+ (kbd "C-k") 'p4-backward-active-link
+ (kbd "RET") 'p4-buffer-commands
+ "q" 'quit-window
+ "gr" 'revert-buffer
+ "]]" 'p4-scroll-down-1-window
+ "[[" 'p4-scroll-up-1-window
+ "gg" 'p4-top-of-buffer
+ "G" 'p4-bottom-of-buffer
+ "=" 'delete-other-windows)
+
+ (evil-collection-define-key 'normal 'p4-basic-list-mode-map
+ (kbd "RET") 'p4-basic-list-activate)
+
+ (evil-collection-define-key 'normal 'p4-opened-list-mode-map
+ "R" 'p4-revert
+ "T" 'p4-opened-list-type
+ "C" 'p4-opened-list-change)
+
+ (evil-collection-define-key 'normal 'p4-status-list-mode-map
+ (kbd "RET") 'p4-status-list-activate)
+
+ (evil-collection-define-key 'normal 'p4-filelog-mode-map
+ "d" 'p4-diff2
+ "gf" 'p4-find-file-other-window
+ "S" 'p4-filelog-short-format
+ "L" 'p4-filelog-long-format
+ " " 'p4-scroll-up-1-window
+ "gg" 'p4-top-of-buffer
+ "G" 'p4-bottom-of-buffer
+ "=" 'p4-delete-other-windows
+ "]]" 'p4-goto-next-change
+ "[[" 'p4-goto-prev-change
+ (kbd "C-j") 'p4-goto-next-change
+ (kbd "C-k") 'p4-goto-prev-change)
+
+ (evil-collection-define-key 'normal 'p4-diff-mode-map
+ "]]" 'diff-hunk-next
+ (kbd "C-j") 'diff-hunk-next
+ (kbd "M-j") 'diff-file-next
+ "[[" 'diff-hunk-prev
+ (kbd "C-k") 'diff-hunk-prev
+ (kbd "M-k") 'diff-file-prev
+ "\t" 'diff-hunk-next
+ [backtab] 'diff-hunk-prev
+ "}" 'diff-file-next
+ "{" 'diff-file-prev
+ "\C-m" 'p4-buffer-commands
+ [mouse-2] 'p4-buffer-commands
+ "gb" 'p4-buffer-commands)
+
+ (evil-collection-define-key 'normal 'p4-annotate-mode-map
+ "]]" 'p4-next-change-rev-line
+ "[[" 'p4-prev-change-rev-line
+ (kbd "C-j") 'p4-next-change-rev-line
+ (kbd "C-k") 'p4-prev-change-rev-line
+ "L" 'p4-toggle-line-wrap))
+
+(provide 'evil-collection-p4)
+;;; evil-collection-p4.el ends here
diff --git a/modes/package-menu/evil-collection-package-menu.el b/modes/package-menu/evil-collection-package-menu.el
new file mode 100644
index 0000000..f920c39
--- /dev/null
+++ b/modes/package-menu/evil-collection-package-menu.el
@@ -0,0 +1,57 @@
+;;; evil-collection-package-menu.el --- Evil bindings for package-menu -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, package-menu, tools
+
+;; 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:
+;; Evil integration for `package-menu-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'package)
+
+(defconst evil-collection-package-menu-maps '(package-menu-mode-map))
+
+;;;###autoload
+(defun evil-collection-package-menu-setup ()
+ "Set up `evil' bindings for `package-menu'."
+ (evil-set-initial-state 'package-menu-mode 'normal)
+
+ (evil-collection-define-key 'normal 'package-menu-mode-map
+ "i" 'package-menu-mark-install
+ "U" 'package-menu-mark-upgrades
+ "d" 'package-menu-mark-delete
+ "gr" 'package-menu-refresh
+
+ ;; undo
+ "u" 'package-menu-mark-unmark
+
+ ;; execute
+ "x" 'package-menu-execute
+
+ "q" 'quit-window ;; FIXME: Can macros make sense here?
+ "ZQ" 'evil-quit
+ "ZZ" 'quit-window))
+
+(provide 'evil-collection-package-menu)
+;;; evil-collection-package-menu.el ends here
diff --git a/modes/pass/evil-collection-pass.el b/modes/pass/evil-collection-pass.el
new file mode 100644
index 0000000..6478697
--- /dev/null
+++ b/modes/pass/evil-collection-pass.el
@@ -0,0 +1,61 @@
+;;; evil-collection-pass.el --- Evil bindings for pass-mode -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, pass, tools
+
+;; 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:
+;; Evil bindings for `pass-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'pass nil t)
+
+(defvar pass-mode-map)
+
+(defconst evil-collection-pass-maps '(pass-mode-map))
+
+;;;###autoload
+(defun evil-collection-pass-setup ()
+ "Set up `evil' bindings for `pass-mode'."
+ (evil-collection-define-key 'normal 'pass-mode-map
+ "gj" 'pass-next-entry
+ "gk" 'pass-prev-entry
+ (kbd "C-j") 'pass-next-entry
+ (kbd "C-k") 'pass-prev-entry
+ (kbd "]]") 'pass-next-directory
+ (kbd "[[") 'pass-prev-directory
+ "d" 'pass-kill
+ "x" 'pass-kill
+ "s" 'isearch-forward
+ "g?" 'describe-mode
+ "gr" 'pass-update-buffer
+ "i" 'pass-insert
+ "I" 'pass-insert-generated
+ "Y" 'pass-copy
+ "r" 'pass-rename
+ "o" 'pass-otp-options
+ (kbd "RET") 'pass-view
+ "q" 'pass-quit))
+
+(provide 'evil-collection-pass)
+;;; evil-collection-pass.el ends here
diff --git a/modes/pdf/evil-collection-pdf.el b/modes/pdf/evil-collection-pdf.el
new file mode 100644
index 0000000..54c43cd
--- /dev/null
+++ b/modes/pdf/evil-collection-pdf.el
@@ -0,0 +1,283 @@
+;;; evil-collection-pdf.el --- Evil bindings for pdf-tools -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, pdf, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for pdf-tools.
+
+;;; Code:
+(require 'evil-collection)
+(require 'pdf-tools nil t)
+(require 'pdf-view nil t)
+
+(defconst evil-collection-pdf-maps '(pdf-view-mode-map
+ pdf-outline-buffer-mode-map
+ pdf-occur-buffer-mode-map))
+
+(declare-function pdf-view-last-page "pdf-view")
+(declare-function pdf-view-first-page "pdf-view")
+(declare-function pdf-view-goto-page "pdf-view")
+(declare-function pdf-view-previous-line-or-previous-page "pdf-view")
+(declare-function pdf-view-next-line-or-next-page "pdf-view")
+
+(defvar pdf-view-mode-map)
+(defvar pdf-outline-buffer-mode-map)
+(defvar pdf-occur-buffer-mode-map)
+
+(defvar pdf-view-mode-map)
+(defvar pdf-outline-buffer-mode-map)
+(defvar pdf-occur-buffer-mode-map)
+
+;; TODO: The following 2 functions are workarounds for
+;; 'pdf-view-next-line-or-next-page' and
+;; 'pdf-view-previous-line-or-previous-page' not playing well with
+;; EVIL. The root cause should be found and fixed instead.
+;; See https://github.com/emacs-evil/evil-collection/pull/137 for
+;; details.
+(defun evil-collection-pdf-view-next-line-or-next-page (&optional count)
+ "'evil' wrapper include a count argument to `pdf-view-next-line-or-next-page'"
+ (interactive "P")
+ (if count
+ (dotimes (_ count nil)
+ (pdf-view-next-line-or-next-page 1))
+ (pdf-view-next-line-or-next-page 1)))
+
+(defun evil-collection-pdf-view-previous-line-or-previous-page (&optional count)
+ "'evil' wrapper include a count argument to `pdf-view-previous-line-or-previous-page'"
+ (interactive "P")
+ (if count
+ (dotimes (_ count nil)
+ (pdf-view-previous-line-or-previous-page 1))
+ (pdf-view-previous-line-or-previous-page 1)))
+
+(defun evil-collection-pdf-view-goto-page (&optional page)
+ "`evil' wrapper around `pdf-view-last-page'."
+ (interactive "P")
+ (if page
+ (pdf-view-goto-page page)
+ (pdf-view-last-page)
+ (image-eob)))
+
+(defun evil-collection-pdf-view-goto-first-page (&optional page)
+ "`evil' wrapper around `pdf-view-first-page'."
+ (interactive "P")
+ (if page
+ (pdf-view-goto-page page)
+ (pdf-view-first-page)
+ (image-bob)))
+
+;;;###autoload
+(defun evil-collection-pdf-setup ()
+ "Set up `evil' bindings for `pdf-view'."
+ (evil-collection-inhibit-insert-state 'pdf-view-mode-map)
+ (evil-set-initial-state 'pdf-view-mode 'normal)
+ (evil-collection-define-key 'normal 'pdf-view-mode-map
+ ;; motion
+ (kbd "RET") 'image-next-line
+ "j" 'evil-collection-pdf-view-next-line-or-next-page
+ "k" 'evil-collection-pdf-view-previous-line-or-previous-page
+ (kbd "SPC") 'pdf-view-scroll-up-or-next-page
+ (kbd "S-SPC") 'pdf-view-scroll-down-or-previous-page
+ (kbd "<delete>") 'pdf-view-scroll-down-or-previous-page
+ (kbd "C-f") 'pdf-view-scroll-up-or-next-page
+ (kbd "C-b") 'pdf-view-scroll-down-or-previous-page
+ "]]" 'pdf-view-next-page-command
+ "[[" 'pdf-view-previous-page-command
+ (kbd "C-j") 'pdf-view-next-page-command
+ (kbd "C-k") 'pdf-view-previous-page-command
+ "gj" 'pdf-view-next-page-command
+ "gk" 'pdf-view-previous-page-command
+ (kbd "<next>") 'forward-page
+ (kbd "<prior>") 'backward-page
+ (kbd "<down>") 'evil-collection-pdf-view-next-line-or-next-page
+ (kbd "<up>") 'evil-collection-pdf-view-previous-line-or-previous-page
+ "gg" 'evil-collection-pdf-view-goto-first-page
+ "G" 'evil-collection-pdf-view-goto-page
+
+ ;; mark
+ "'" 'pdf-view-jump-to-register
+ "m" 'pdf-view-position-to-register
+
+ ;; zoom
+ "+" 'pdf-view-enlarge
+ "zi" 'pdf-view-enlarge
+ "=" 'pdf-view-enlarge
+ "-" 'pdf-view-shrink
+ "zo" 'pdf-view-shrink
+ "0" 'pdf-view-scale-reset
+ "z0" 'pdf-view-scale-reset
+
+ ;; TODO: Why are those image-* bindings in pdf-tools?
+ "a+" 'image-increase-speed
+ "a-" 'image-decrease-speed
+ "a0" 'image-reset-speed
+ "ar" 'image-reverse-speed
+ "F" 'image-goto-frame
+ "b" 'image-previous-frame
+ "f" 'image-next-frame
+ "h" 'image-backward-hscroll
+ "^" 'image-bol
+ "$" 'image-eol
+ "l" 'image-forward-hscroll
+
+ "H" 'pdf-view-fit-height-to-window ; evil-image has "H"
+ "P" 'pdf-view-fit-page-to-window
+ "W" 'pdf-view-fit-width-to-window ; evil-image has "W"
+
+ ;; refresh
+ "gr" 'revert-buffer
+
+ (kbd "<C-down-mouse-1>") 'pdf-view-mouse-extend-region
+ (kbd "<M-down-mouse-1>") 'pdf-view-mouse-set-region-rectangle
+ (kbd "<down-mouse-1>") 'pdf-view-mouse-set-region
+
+ (kbd "C-c C-c") 'docview-mode
+ (kbd "C-c <tab>") 'pdf-view-extract-region-image
+
+ "sb" 'pdf-view-set-slice-from-bounding-box
+ "sm" 'pdf-view-set-slice-using-mouse
+ "sr" 'pdf-view-reset-slice
+
+ ;; goto
+ "gl" 'pdf-view-goto-label
+
+ ;; search
+ (kbd "M-s o") 'pdf-occur ; TODO: More Evil bindings?
+
+ "/" 'isearch-forward
+ "?" 'isearch-backward
+ "n" 'isearch-repeat-forward
+ "N" 'isearch-repeat-backward
+
+ "zd" 'pdf-view-dark-minor-mode
+ "zm" 'pdf-view-midnight-minor-mode
+ "zp" 'pdf-view-printer-minor-mode
+
+ "o" 'pdf-outline
+
+ ;; quit
+ "q" 'quit-window
+ "Q" 'kill-this-buffer
+ "ZQ" 'kill-this-buffer
+ "ZZ" 'quit-window)
+
+ (evil-collection-define-key 'visual 'pdf-view-mode-map
+ "y" 'pdf-view-kill-ring-save)
+
+ (evil-collection-inhibit-insert-state 'pdf-outline-buffer-mode-map)
+ (evil-set-initial-state 'pdf-outline-buffer-mode 'normal)
+ (evil-collection-define-key 'normal 'pdf-outline-buffer-mode-map
+ ;; open
+ (kbd "RET") 'pdf-outline-follow-link-and-quit
+ (kbd "S-<return>") 'pdf-outline-follow-link
+ (kbd "M-<return>") 'pdf-outline-display-link
+ "go" 'pdf-outline-follow-link
+ "." 'pdf-outline-move-to-current-page
+ (kbd "SPC") 'pdf-outline-select-pdf-window
+
+ "G" 'pdf-outline-end-of-buffer
+ "^" 'pdf-outline-up-heading
+ "<" 'pdf-outline-up-heading ; TODO: Don't set this by default?
+
+ "zf" 'pdf-outline-follow-mode ; Helm has "C-c C-f" in Emacs state.
+
+ ;; quit
+ (kbd "C-w q") 'pdf-outline-quit-and-kill ; TODO: Do we need to set this? I think not.
+ "q" 'quit-window
+ "ZQ" 'quit-window
+ "ZZ" 'pdf-outline-quit-and-kill)
+
+ (evil-collection-inhibit-insert-state 'pdf-occur-buffer-mode-map)
+ (evil-set-initial-state 'pdf-occur-buffer-mode 'normal)
+ (evil-collection-define-key 'normal 'pdf-occur-buffer-mode-map
+ ;; open
+ (kbd "RET") 'pdf-occur-goto-occurrence
+ (kbd "S-<return>") 'pdf-occur-view-occurrence
+ (kbd "SPC") 'pdf-occur-view-occurrence
+ "gd" 'pdf-occur-goto-occurrence
+ "gD" 'pdf-occur-view-occurrence
+
+ "A" 'pdf-occur-tablist-gather-documents
+ "D" 'pdf-occur-tablist-do-delete
+
+ ;; sort
+ "o" 'tabulated-list-sort
+ "O" 'tablist-sort ; TODO: Do we need this?
+
+ ;; refresh
+ "G" 'tablist-revert
+
+ "K" 'pdf-occur-abort-search
+
+ ;; mark
+ "*m" 'tablist-mark-forward
+ "m" 'tablist-mark-forward
+ "~" 'tablist-toggle-marks
+ "u" 'tablist-unmark-forward
+ "U" 'tablist-unmark-all-marks
+ "*!" 'tablist-unmark-all-marks
+ "*c" 'tablist-change-marks
+ "*n" 'tablist-mark-items-numeric
+ "*r" 'tablist-mark-items-regexp
+ "%" 'tablist-mark-items-regexp
+
+ "a" 'tablist-flag-forward
+
+ ;; "f" 'tablist-find-entry ; TODO: Equivalent to 'pdf-occur-goto-occurrence?
+ "r" 'pdf-occur-revert-buffer-with-args
+ "d" 'tablist-do-kill-lines
+ "x" 'pdf-occur-tablist-do-flagged-delete
+ (kbd "<delete>") 'tablist-unmark-backward
+ (kbd "S-SPC") 'scroll-down-command
+ (kbd "<backtab>") 'tablist-backward-column
+ (kbd "C-c C-e") 'tablist-export-csv
+
+ [remap evil-first-non-blank] 'tablist-move-to-major-column
+ [remap evil-next-line] 'tablist-next-line
+ [remap evil-previous-line] 'tablist-previous-line
+
+ ;; filter
+ ;; TODO: See if overriding "/" is a good idea.
+ "/!" 'tablist-negate-filter
+ "//" 'tablist-display-filter
+ "/=" 'tablist-push-equal-filter
+ "/C" 'tablist-clear-filter
+ "/D" 'tablist-delete-named-filter
+ "/a" 'tablist-push-named-filter
+ "/d" 'tablist-deconstruct-named-filter
+ "/e" 'tablist-edit-filter
+ "/n" 'tablist-push-numeric-filter
+ "/p" 'tablist-pop-filter
+ "/r" 'tablist-push-regexp-filter
+ "/s" 'tablist-name-current-filter
+ "/t" 'tablist-toggle-first-filter-logic
+ "/z" 'tablist-suspend-filter
+
+ ;; quit
+ "q" 'tablist-quit
+ "ZQ" 'tablist-quit
+ "ZZ" 'tablist-quit))
+
+(provide 'evil-collection-pdf)
+;;; evil-collection-pdf.el ends here
diff --git a/modes/popup/evil-collection-popup.el b/modes/popup/evil-collection-popup.el
new file mode 100644
index 0000000..a81ddfd
--- /dev/null
+++ b/modes/popup/evil-collection-popup.el
@@ -0,0 +1,44 @@
+;;; evil-collection-popup.el --- Bindings for `popup'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;; Bindings for `popup'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'popup nil t)
+
+(defconst evil-collection-popup-maps '(popup-menu-keymap))
+
+;;;###autoload
+(defun evil-collection-popup-setup ()
+ "Set up `evil' bindings for `popup'."
+ (defvar popup-menu-keymap)
+ (evil-collection-define-key nil 'popup-menu-keymap
+ (kbd "C-j") 'popup-next
+ (kbd "C-k") 'popup-previous))
+
+(provide 'evil-collection-popup)
+;;; evil-collection-popup.el ends here
diff --git a/modes/proced/evil-collection-proced.el b/modes/proced/evil-collection-proced.el
new file mode 100644
index 0000000..485d4d3
--- /dev/null
+++ b/modes/proced/evil-collection-proced.el
@@ -0,0 +1,93 @@
+;;; evil-collection-proced.el --- Evil bindings for proced -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, proced, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for proced.
+
+;;; Code:
+(require 'evil-collection)
+(require 'proced)
+
+(defconst evil-collection-proced-maps '(proced-mode-map))
+
+;;;###autoload
+(defun evil-collection-proced-setup ()
+ "Set up `evil' bindings for `proced'."
+ (evil-collection-inhibit-insert-state 'proced-mode-map)
+ (evil-set-initial-state 'proced-mode 'normal)
+ (evil-collection-define-key 'normal 'proced-mode-map
+ (kbd "RET") 'proced-refine
+
+ ;; mark
+ ;; TODO: Implement a proced-toggle-mark?
+ "m" 'proced-mark ; Mentioned in documentation, should be followed.
+ "*" 'proced-mark-all
+ "M" 'proced-mark-all
+ "U" 'proced-unmark-all
+ "~" 'proced-toggle-marks
+ "c" 'proced-mark-children
+ "C" 'proced-mark-children ; Emacs has "C"
+ "p" 'proced-mark-parents
+ "P" 'proced-mark-parents ; Emacs has "P"
+ (kbd "<delete>") 'proced-unmark-backward
+
+ ;; motion
+ ;; TODO: Implement beginning-of-buffer / end-of-buffer.
+ (kbd "SPC") 'evil-scroll-down
+ (kbd "S-SPC") 'evil-scroll-up
+
+ "zt" 'proced-toggle-tree
+
+ "u" 'proced-undo
+
+ "O" 'proced-omit-processes ; TODO: Change default binding?
+
+ "x" 'proced-send-signal ; Emacs has "k" and "x", "k" is mentioned in documentation
+
+ ;; filter
+ "s" 'proced-filter-interactive ; Refers to "[s]elect", Emacs has "f" mentioned in documentation.
+ "S" 'proced-format-interactive
+
+ ;; sort
+ "oo" 'proced-sort-start ; Refers to "[o]rder", Emacs has "s" mentioned in documentation.
+ "oO" 'proced-sort-interactive
+ "oc" 'proced-sort-pcpu
+ "om" 'proced-sort-pmem
+ "op" 'proced-sort-pid
+ "ot" 'proced-sort-time
+ "ou" 'proced-sort-user
+
+ "r" 'proced-renice
+
+ ;; refresh
+ "gr" 'revert-buffer
+
+ ;; quit
+ "q" 'quit-window ; TODO: Macro support?
+ "ZQ" 'evil-quit
+ "ZZ" 'quit-window))
+
+(provide 'evil-collection-proced)
+;;; evil-collection-proced.el ends here
diff --git a/modes/prodigy/evil-collection-prodigy.el b/modes/prodigy/evil-collection-prodigy.el
new file mode 100644
index 0000000..dc8d8bc
--- /dev/null
+++ b/modes/prodigy/evil-collection-prodigy.el
@@ -0,0 +1,80 @@
+;;; evil-collection-prodigy.el --- Evil bindings for prodigy -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, prodigy, tools
+
+;; 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:
+;; Evil bindings for `prodigy'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'prodigy nil t)
+
+(defconst evil-collection-prodigy-maps '(prodigy-mode-map
+ prodigy-view-mode-map))
+
+;;;###autoload
+(defun evil-collection-prodigy-setup ()
+ "Set up `evil' bindings for `prodigy'."
+ (evil-collection-define-key 'normal 'prodigy-mode-map
+ ;; quit
+ "q" 'quit-window
+
+ "j" 'prodigy-next
+ "k" 'prodigy-prev
+ "gg" 'prodigy-first
+ "G" 'prodigy-last
+
+ ;; mark
+ "m" 'prodigy-mark
+ "*t" 'prodigy-mark-tag
+ "M" 'prodigy-mark-all
+ "u" 'prodigy-unmark
+ "*T" 'prodigy-unmark-tag
+ "U" 'prodigy-unmark-all
+
+ "s" 'prodigy-start
+ "S" 'prodigy-stop
+
+ ;; refresh
+ "gr" 'prodigy-restart
+
+ "`" 'prodigy-display-process
+ (kbd "RET") 'prodigy-browse
+ "it" 'prodigy-add-tag-filter
+ "in" 'prodigy-add-name-filter
+ "I" 'prodigy-clear-filters
+ "Jm" 'prodigy-jump-magit
+ "Jd" 'prodigy-jump-dired
+
+ "gj" 'prodigy-next-with-status
+ "gk" 'prodigy-prev-with-status
+ (kbd "C-j") 'prodigy-next-with-status
+ (kbd "C-k") 'prodigy-prev-with-status
+ (kbd "Y") 'prodigy-copy-cmd)
+
+ (evil-collection-define-key 'normal 'prodigy-view-mode-map
+ "x" 'prodigy-view-clear-buffer))
+
+(provide 'evil-collection-prodigy)
+;;; evil-collection-prodigy.el ends here
diff --git a/modes/profiler/evil-collection-profiler.el b/modes/profiler/evil-collection-profiler.el
new file mode 100644
index 0000000..0432110
--- /dev/null
+++ b/modes/profiler/evil-collection-profiler.el
@@ -0,0 +1,71 @@
+;;; evil-collection-profiler.el --- Evil bindings for profiler -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, profiler, tools
+
+;; 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:
+;; Evil bindings for `profiler'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'profiler)
+
+(defconst evil-collection-profiler-maps '(profiler-report-mode-map))
+
+;;;###autoload
+(defun evil-collection-profiler-setup ()
+ "Set up `evil' bindings for `profiler'."
+ (evil-set-initial-state 'profiler-report-mode 'normal)
+
+ (evil-collection-define-key 'normal 'profiler-report-mode-map
+ ;; motion
+ (kbd "SPC") 'scroll-up-command
+ (kbd "S-SPC") 'scroll-down-command
+ (kbd "<delete>") 'scroll-down-command
+ "j" 'profiler-report-next-entry
+ "k" 'profiler-report-previous-entry
+
+ (kbd "<tab>") 'profiler-report-toggle-entry
+
+ ;; sort
+ "o" 'profiler-report-ascending-sort
+ "O" 'profiler-report-descending-sort
+
+ "c" 'profiler-report-render-calltree
+ "C" 'profiler-report-render-reversed-calltree
+ "i" 'profiler-report-describe-entry
+ "=" 'profiler-report-compare-profile
+
+ ;; open
+ (kbd "RET") 'profiler-report-find-entry
+
+ ;; refresh
+ "gr" 'revert-buffer
+
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'evil-quit
+ "ZZ" 'quit-windw))
+
+(provide 'evil-collection-profiler)
+;;; evil-collection-profiler.el ends here
diff --git a/modes/python/evil-collection-python.el b/modes/python/evil-collection-python.el
new file mode 100644
index 0000000..1a27d87
--- /dev/null
+++ b/modes/python/evil-collection-python.el
@@ -0,0 +1,48 @@
+;;; evil-collection-python.el --- Bindings for `python'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: emacs, tools
+
+;; 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:
+;;; Bindings for `python'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'python)
+
+(defconst evil-collection-python-maps '(python-mode-map))
+
+(defun evil-collection-python-set-evil-shift-width ()
+ "Set `evil-shift-width' according to `python-indent-offset'."
+ (setq evil-shift-width python-indent-offset))
+
+;;;###autoload
+(defun evil-collection-python-setup ()
+ "Set up `evil' bindings for `python'."
+ (add-hook 'python-mode-hook #'evil-collection-python-set-evil-shift-width)
+
+ (evil-collection-define-key 'normal 'python-mode-map
+ "gz" 'python-shell-switch-to-shell))
+
+(provide 'evil-collection-python)
+;;; evil-collection-python.el ends here
diff --git a/modes/quickrun/evil-collection-quickrun.el b/modes/quickrun/evil-collection-quickrun.el
new file mode 100644
index 0000000..294fee7
--- /dev/null
+++ b/modes/quickrun/evil-collection-quickrun.el
@@ -0,0 +1,42 @@
+;;; evil-collection-quickrun.el --- Bindings for `quickrun'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools, quickrun
+
+;; 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:
+;; Bindings for `quickrun'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'quickrun nil t)
+
+(defconst evil-collection-quickrun-maps '(quickrun--mode-map))
+
+;;;###autoload
+(defun evil-collection-quickrun-setup ()
+ "Set up `evil' bindings for `quickrun'.."
+ (evil-collection-define-key 'normal 'quickrun--mode-map
+ "q" 'quit-window))
+
+(provide 'evil-collection-quickrun)
+;;; evil-collection-quickrun.el ends here
diff --git a/modes/racer/evil-collection-racer.el b/modes/racer/evil-collection-racer.el
new file mode 100644
index 0000000..6cb75db
--- /dev/null
+++ b/modes/racer/evil-collection-racer.el
@@ -0,0 +1,48 @@
+;;; evil-collection-racer.el --- Bindings for `racer'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: emacs, rust, tools, evil
+
+;; 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:
+;; Bindings for `racer'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'racer nil t)
+
+(defconst evil-collection-racer-maps '(racer-mode-map
+ racer-help-mode-map))
+
+;;;###autoload
+(defun evil-collection-racer-setup ()
+ "Set up `evil' bindings for `racer'."
+ (evil-collection-define-key 'normal 'racer-mode-map
+ "gd" 'racer-find-definition
+ (kbd "C-t") 'pop-tag-mark
+ "K" 'racer-describe)
+
+ (evil-collection-define-key 'normal 'racer-help-mode-map
+ "q" 'quit-window))
+
+(provide 'evil-collection-racer)
+;;; evil-collection-racer.el ends here
diff --git a/modes/realgud/evil-collection-realgud.el b/modes/realgud/evil-collection-realgud.el
new file mode 100644
index 0000000..b9f8308
--- /dev/null
+++ b/modes/realgud/evil-collection-realgud.el
@@ -0,0 +1,103 @@
+;;; evil-collection-realgud.el --- Bindings for `realgud'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools, realgud
+
+;; 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:
+;; Bindings for `realgud'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'realgud nil t)
+
+(defconst evil-collection-realgud-maps '(realgud:shortkey-mode-map))
+
+;;;###autoload
+(defun evil-collection-realgud-setup ()
+ "Set up `evil' bindings for `realgud'."
+ ;; This one is to represent `realgud-populate-src-buffer-map-plain'.
+ (evil-collection-define-key 'normal 'realgud:shortkey-mode-map
+ "b" 'realgud:cmd-break
+ "D" 'realgud:cmd-delete
+ "X" 'realgud:cmd-clear
+ "-" 'realgud:cmd-disable
+ "+" 'realgud:cmd-enable
+ "T" 'realgud:cmd-backtrace
+ "f" 'realgud:cmd-finish
+ "n" 'realgud:cmd-next
+ "q" 'realgud:cmd-quit
+ "Q" 'realgud:cmd-kill
+ "r" 'realgud:cmd-restart
+ "R" 'realgud:cmd-restart
+ "s" 'realgud:cmd-step
+ "i" 'realgud:cmd-step
+ "!" 'realgud:cmd-shell
+
+ ;; (evil-collection-define-key nil map [M-down] 'realgud-track-hist-newer)
+ ;; (evil-collection-define-key nil map [M-kp-2] 'realgud-track-hist-newer)
+ ;; (evil-collection-define-key nil map [M-up] 'realgud-track-hist-older)
+ ;; (evil-collection-define-key nil map [M-kp-8] 'realgud-track-hist-older)
+ ;; (evil-collection-define-key nil map [M-kp-up] 'realgud-track-hist-older)
+ ;; (evil-collection-define-key nil map [M-kp-down] 'realgud-track-hist-newer)
+ ;; (evil-collection-define-key nil map [M-print] 'realgud-track-hist-older)
+ ;; (evil-collection-define-key nil map [M-S-down] 'realgud-track-hist-newest)
+ ;; (evil-collection-define-key nil map [M-S-up] 'realgud-track-hist-oldest)
+ )
+
+ (evil-collection-define-key 'normal 'realgud:shortkey-mode-map
+ (kbd "C-x C-q") 'realgud-short-key-mode
+ "1" 'realgud-goto-arrow1
+ "2" 'realgud-goto-arrow2
+ "3" 'realgud-goto-arrow3
+ "4" 'realgud:goto-loc-hist-4
+ "5" 'realgud:goto-loc-hist-5
+ "6" 'realgud:goto-loc-hist-6
+ "7" 'realgud:goto-loc-hist-7
+ "8" 'realgud:goto-loc-hist-8
+ "9" 'realgud:goto-loc-hist-9
+ "b" 'realgud:cmd-break
+ "J" 'realgud:cmd-jump
+ "c" 'realgud:cmd-continue
+ "e" 'realgud:cmd-eval-dwim
+ "E" 'realgud:cmd-eval-at-point
+ "U" 'realgud:cmd-until
+ "H" 'realgud:cmd-until
+ [mouse-2] 'realgud:tooltip-eval
+ [left-fringe mouse-1] 'realgud-cmds--mouse-add-remove-bp
+ [left-margin mouse-1] 'realgud-cmds--mouse-add-remove-bp
+ ">" 'realgud:cmd-newer-frame
+ "<" 'realgud:cmd-older-frame
+ "d" 'realgud:cmd-newer-frame
+ "u" 'realgud:cmd-older-frame
+ "gR" 'realgud-recenter-arrow ;; FIXME: Hmnn!
+ "C" 'realgud-window-cmd-undisturb-src
+ "g?" 'realgud:cmdbuf-info-describe
+ "S" 'realgud-window-src-undisturb-cmd
+ "R" 'realgud:cmd-restart
+ "gr" 'realgud:cmd-restart
+ "!" 'realgud:cmd-shell)
+
+ (add-hook 'realgud-short-key-mode-hook #'evil-normalize-keymaps))
+
+(provide 'evil-collection-realgud)
+;;; evil-collection-realgud.el ends here
diff --git a/modes/reftex/evil-collection-reftex.el b/modes/reftex/evil-collection-reftex.el
new file mode 100644
index 0000000..b4705a7
--- /dev/null
+++ b/modes/reftex/evil-collection-reftex.el
@@ -0,0 +1,142 @@
+;;; evil-collection-reftex.el --- Bindings for `reftex'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Maximiliano Sandoval <msandova@protonmail.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, reftex, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for `reftex-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'reftex-ref nil t)
+(require 'reftex-ref nil t)
+(require 'reftex-cite nil t)
+
+(defconst evil-collection-reftex-maps '(reftex-select-shared-map
+ reftex-toc-mode-map))
+
+;; original code can be found in reftex-ref.el
+(setq reftex-select-label-prompt
+ "Select: [RET]select [j]next [k]previous [gr]escan [go]context [q]uit [g?]help")
+
+;; original code can be found in reftex-cite.el
+(setq reftex-citation-prompt
+ "Select: [RET]select [j]next [k]previous [q]uit [g?]help")
+
+;; original at reftex-ref.el
+(setq reftex-select-label-help
+ " j / k Go to next/previous label (Cursor motion works as well)
+ [ / ] Go to previous/next section heading.
+ c Reuse last referenced label.
+ J Jump to a specific section, e.g. '3 J' jumps to section 3.
+ s Switch label type.
+ gr Reparse document.
+ go / gO Show context / Show insertion point.
+ S Switch to label menu of external document (with LaTeX package `xr').
+ r / R Toggle \\ref <-> \\vref / Rotate \\ref <=> \\fref <=> \\Fref.
+ TAB Enter a label with completion.
+ m / M Mark/unmark entry.
+ x / X Put all marked entries into one/many \\ref commands.
+ q / RET Quit without referencing / Accept current label.")
+
+;; code can be found in reftex-cite.el
+(setq reftex-citation-help
+ " j / k Go to next/previous entry (Cursor motion works as well).
+ go / gO Show citation / Show insertion point.
+ q Quit without inserting \\cite macro into buffer.
+ TAB Enter citation key with completion.
+ RET Accept current entry and create \\cite macro.
+ m / M Mark/Unmark the entry.
+ o / O Create BibTeX file with all marked / unmarked entries.
+ X / X Put all (marked) entries into one/many \\cite commands.")
+
+;;;###autoload
+(defun evil-collection-reftex-setup ()
+ "Set up `evil' bindings for `reftex'."
+
+ (evil-set-initial-state 'reftex-select-label-mode 'normal)
+ (evil-set-initial-state 'reftex-select-bib-mode 'normal)
+
+ (evil-collection-define-key 'normal 'reftex-select-shared-map
+ "j" 'reftex-select-next
+ "k" 'reftex-select-previous
+ (kbd "]]") 'reftex-select-next-heading
+ (kbd "[[") 'reftex-select-previous-heading
+ (kbd "gj") 'reftex-select-next-heading
+ (kbd "gk") 'reftex-select-previous-heading
+ (kbd "C-j") 'reftex-select-next-heading
+ (kbd "C-k") 'reftex-select-previous-heading
+ "go" 'reftex-select-callback ;shows the point where the label is
+ "gr" (lambda nil "Press `?' during selection to find out
+ about this key" (interactive) (throw (quote myexit) 114)) ;reftex binds keys in a very arcane way using the number asigned by describe-char, in this case the value of "g" is 114
+ "q" 'reftex-select-quit
+ "ZZ" 'reftex-select-quit
+ "ZQ" 'evil-quit
+ "g?" 'reftex-select-help
+ "c" (lambda nil "Press `?' during selection to find out
+ about this key." (interactive) (throw (quote myexit) 108))
+ "J" 'reftex-select-jump ;; weird binding, using default
+ (kbd "<tab>") 'reftex-select-read-label
+ "s" (lambda nil "Press `?' during selection to find out
+ about this key." (interactive) (throw (quote myexit) 115))
+ "x" (lambda nil "Press `?' during selection to find out
+ about this key." (interactive) (throw (quote myexit) 97))
+ "X" (lambda nil "Press `?' during selection to find out
+ about this key." (interactive) (throw (quote myexit) 65))
+ "S" (lambda nil "Press `?' during selection to find out
+ about this key." (interactive) (throw (quote myexit) 120))
+ "r" 'reftex-select-cycle-ref-style-forward
+ "R" 'reftex-select-cycle-ref-style-backward
+ "gO" 'reftex-select-show-insertion-point
+ "o" (lambda nil "Press `?' during selection to find out
+ about this key." (interactive) (throw (quote myexit) 101))
+ "O" (lambda nil "Press `?' during selection to find out
+ about this key." (interactive) (throw (quote myexit) 69))
+
+ ;; mark
+ "m" 'reftex-select-mark ; TODO: Need a mark toggle function.
+ "u" 'reftex-select-unmark)
+
+ (evil-set-initial-state 'reftex-toc-mode 'normal)
+
+ ;; This one is more involved, in reftex-toc.el, line 282 it shows the prompt
+ ;; string with the keybinds and I don't see any way of changing it to show evil-like binds.
+ (evil-collection-define-key 'normal 'reftex-toc-mode-map
+ "j" 'reftex-toc-next
+ "k" 'reftex-toc-previous
+ (kbd "RET") 'reftex-toc-goto-line-and-hide
+ (kbd "<tab>") 'reftex-toc-goto-line
+ "g?" 'reftex-toc-show-help
+ "q" 'reftex-toc-quit
+ "ZZ" 'reftex-toc-quit
+ "ZQ" 'evil-quit
+ "gr" 'reftex-toc-rescan
+ "r" 'reftex-toc-rescan
+ "l" 'reftex-toc-toggle-labels
+ "?" 'reftex-toc-show-help
+ "x" 'reftex-toc-external
+ ;; (kbd "SPC") 'reftex-toc-view-line
+ "f" 'reftex-toc-toggle-follow))
+
+(provide 'evil-collection-reftex)
+;;; evil-collection-reftex.el ends here
diff --git a/modes/rjsx-mode/evil-collection-rjsx-mode.el b/modes/rjsx-mode/evil-collection-rjsx-mode.el
new file mode 100644
index 0000000..ab83059
--- /dev/null
+++ b/modes/rjsx-mode/evil-collection-rjsx-mode.el
@@ -0,0 +1,47 @@
+;;; evil-collection-rjsx-mode.el --- Bindings for `rjsx-mode'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, rjsx, tools
+
+;; 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:
+;;; Bindings for `rjsx-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'rjsx-mode nil t)
+
+(defvar rjsx-mode-map)
+
+(defconst evil-collection-rjsx-maps '(rjsx-mode-map))
+
+;;;###autoload
+(defun evil-collection-rjsx-mode-setup ()
+ "Set up `evil' bindings for `rjsx-mode'."
+ (when evil-want-C-d-scroll
+ (evil-collection-define-key 'insert 'rjsx-mode-map
+ (kbd "C-d") 'rjsx-delete-creates-full-tag)
+ (evil-collection-define-key 'normal 'rjsx-mode-map
+ (kbd "C-d") 'evil-scroll-down)))
+
+(provide 'evil-collection-rjsx-mode)
+;;; evil-collection-rjsx-mode.el ends here
diff --git a/modes/robe/evil-collection-robe.el b/modes/robe/evil-collection-robe.el
new file mode 100644
index 0000000..576622a
--- /dev/null
+++ b/modes/robe/evil-collection-robe.el
@@ -0,0 +1,45 @@
+;;; evil-collection-robe.el --- Bindings for `robe'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: emacs, evil, tools, robe
+
+;; 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:
+;;; Bindings for `robe'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'robe nil t)
+
+(defconst evil-collection-robe-maps '(robe-mode-map))
+
+;;;###autoload
+(defun evil-collection-robe-setup ()
+ "Set up `evil' bindings for `robe'."
+ (evil-collection-define-key 'normal 'robe-mode-map
+ "gd" 'robe-jump
+ (kbd "C-t") 'pop-tag-mark
+ "K" 'robe-doc
+ "gr" 'robe-rails-refresh))
+
+(provide 'evil-collection-robe)
+;;; evil-collection-robe.el ends here
diff --git a/modes/rtags/evil-collection-rtags.el b/modes/rtags/evil-collection-rtags.el
new file mode 100644
index 0000000..487e7ea
--- /dev/null
+++ b/modes/rtags/evil-collection-rtags.el
@@ -0,0 +1,141 @@
+;;; evil-collection-rtags.el --- Evil bindings for `rtags'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, rtags, tools
+
+;; 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:
+;;; Evil bindings for `rtags'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'rtags nil t)
+
+(defvar rtags-mode-map)
+(defvar rtags-dependency-tree-mode-map)
+(defvar rtags-references-tree-mode-map)
+(defvar rtags-location-stack-visualize-mode-map)
+
+(defconst evil-collection-rtags-maps '(rtags-mode-map
+ rtags-dependency-tree-mode-map
+ rtags-references-tree-mode-map
+ rtags-location-stack-visualize-mode-map))
+
+;;;###autoload
+(defun evil-collection-rtags-setup ()
+ "Set up `evil' bindings for `rtags'."
+ (evil-set-initial-state 'rtags-mode 'normal)
+ (evil-set-initial-state 'rtags-dependency-tree-mode 'normal)
+ (evil-set-initial-state 'rtags-references-tree-mode 'normal)
+ (evil-set-initial-state 'rtags-location-stack-visualize-mode 'normal)
+
+ (evil-collection-define-key 'normal 'rtags-mode-map
+ ;; open
+ (kbd "RET") 'rtags-select
+ (kbd "S-<return>") 'rtags-select-other-window
+ (kbd "M-<return>") 'rtags-show-in-other-window
+ (kbd "go") 'rtags-select-other-window
+ (kbd "gO") 'rtags-show-in-other-window
+ [mouse-1] 'rtags-select-other-window
+ [mouse-2] 'rtags-select-other-window
+
+ "c" 'rtags-select-caller
+ "C" 'rtags-select-caller-other-window
+ "x" 'rtags-select-and-remove-rtags-buffer
+ "q" 'rtags-call-bury-or-delete)
+
+ (evil-collection-define-key 'normal 'rtags-dependency-tree-mode-map
+ (kbd "<tab>") 'rtags-dependency-tree-toggle-current-expanded
+ "E" 'rtags-dependency-tree-expand-all
+ "c" 'rtags-dependency-tree-collapse-all
+ "-" 'rtags-dependency-tree-collapse-current
+ "+" 'rtags-dependency-tree-expand-current
+ "P" 'rtags-dependency-tree-find-path
+ "gf" 'rtags-dependency-tree-find-path
+
+ "gj" 'rtags-dependency-tree-next-level
+ "gk" 'rtags-dependency-tree-previous-level
+
+ (kbd "C-j") 'rtags-dependency-tree-next-level
+ (kbd "C-k") 'rtags-dependency-tree-previous-level
+ "]]" 'rtags-dependency-tree-next-level
+ "[[" 'rtags-dependency-tree-previous-level
+
+ ;; open
+ (kbd "RET") 'rtags-select
+ (kbd "S-<return>") 'rtags-select-other-window
+ (kbd "M-<return>") 'rtags-show-in-other-window
+ "go" 'rtags-select-other-window
+ "gO" 'rtags-show-in-other-window
+ [mouse-1] 'rtags-select-other-window
+ [mouse-2] 'rtags-select-other-window
+ "s" 'rtags-show-in-other-window
+
+ "x" 'rtags-select-and-remove-rtags-buffer
+ "q" 'rtags-call-bury-or-delete)
+
+ (evil-collection-define-key 'normal 'rtags-references-tree-mode-map
+ (kbd "<tab>") 'rtags-references-tree-toggle-current-expanded
+
+ "E" 'rtags-references-tree-expand-all
+ "c" 'rtags-references-tree-collapse-all
+ "-" 'rtags-references-tree-collapse-current
+ "+" 'rtags-references-tree-expand-current
+
+ "gj" 'rtags-references-tree-next-level
+ "gk" 'rtags-references-tree-previous-level
+
+ (kbd "C-j") 'rtags-references-tree-next-level
+ (kbd "C-k") 'rtags-references-tree-previous-level
+
+ "]]" 'rtags-references-tree-next-level
+ "[[" 'rtags-references-tree-previous-level
+
+ ;; open
+ (kbd "RET") 'rtags-select
+ (kbd "S-<return>") 'rtags-select-other-window
+ (kbd "M-<return>") 'rtags-show-in-other-window
+ "go" 'rtags-select-other-window
+ "gO" 'rtags-show-in-other-window
+ [mouse-1] 'rtags-select-other-window
+ [mouse-2] 'rtags-select-other-window
+ "s" 'rtags-show-in-other-window
+
+ "x" 'rtags-select-and-remove-rtags-buffer
+ "q" 'rtags-call-bury-or-delete)
+
+ (evil-collection-define-key 'normal 'rtags-location-stack-visualize-mode-map
+ ;; open
+ (kbd "RET") 'rtags-select
+ (kbd "S-<return>") 'rtags-select-other-window
+ (kbd "M-<return>") 'rtags-show-in-other-window
+ (kbd "go") 'rtags-select-other-window
+ (kbd "gO") 'rtags-show-in-other-window
+ [mouse-1] 'rtags-select-other-window
+ [mouse-2] 'rtags-select-other-window
+ "s" 'rtags-show-in-other-window
+
+ "x" 'rtags-select-and-remove-rtags-buffer
+ "q" 'rtags-call-bury-or-delete))
+
+(provide 'evil-collection-rtags)
+;;; evil-collection-rtags.el ends here
diff --git a/modes/ruby-mode/evil-collection-ruby-mode.el b/modes/ruby-mode/evil-collection-ruby-mode.el
new file mode 100644
index 0000000..00d3348
--- /dev/null
+++ b/modes/ruby-mode/evil-collection-ruby-mode.el
@@ -0,0 +1,45 @@
+;;; evil-collection-ruby-mode.el --- Bindings for `ruby-mode'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: emacs, tools, ruby
+
+;; 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:
+;;; Bindings for `ruby-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'ruby-mode)
+
+(defconst evil-collection-ruby-mode-maps nil)
+
+(defun evil-collection-ruby-mode-set-evil-shift-width ()
+ "Set `evil-shift-width' according to `ruby-indent-level'."
+ (setq evil-shift-width ruby-indent-level))
+
+;;;###autoload
+(defun evil-collection-ruby-mode-setup ()
+ "Set up `evil' bindings for `ruby'."
+ (add-hook 'ruby-mode-hook #'evil-collection-ruby-mode-set-evil-shift-width))
+
+(provide 'evil-collection-ruby-mode)
+;;; evil-collection-ruby-mode.el ends here
diff --git a/modes/simple/evil-collection-simple.el b/modes/simple/evil-collection-simple.el
new file mode 100644
index 0000000..b5ad024
--- /dev/null
+++ b/modes/simple/evil-collection-simple.el
@@ -0,0 +1,48 @@
+;;; evil-collection-simple.el --- Bindings for `simple' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;; Bindings for `simple'
+
+;;; Code:
+(require 'evil-collection)
+(require 'simple)
+
+(defvar special-mode-map)
+
+(defconst evil-collection-simple-maps '(special-mode-map))
+
+;;;###autoload
+(defun evil-collection-simple-setup ()
+ "Set up `evil' bindings for `simple'."
+ (evil-collection-define-key '(normal visual) 'special-mode-map
+ "q" 'quit-window
+ " " 'scroll-up-command
+ "g?" 'describe-mode
+ "h" 'evil-backward-char
+ "gr" 'revert-buffer))
+
+(provide 'evil-collection-simple)
+;;; evil-collection-simple.el ends here
diff --git a/modes/slime/evil-collection-slime.el b/modes/slime/evil-collection-slime.el
new file mode 100644
index 0000000..c99e349
--- /dev/null
+++ b/modes/slime/evil-collection-slime.el
@@ -0,0 +1,205 @@
+;;; evil-collection-slime.el --- Evil bindings for `slime' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, slime, tools
+
+;; 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:
+;; Evil bindings for `slime-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'slime nil t)
+
+(defvar slime-parent-map)
+(defvar sldb-mode-map)
+(defvar slime-inspector-mode-map)
+(defvar slime-mode-map)
+(defvar slime-popup-buffer-mode-map)
+(defvar slime-xref-mode-map)
+
+(defconst evil-collection-slime-maps '(slime-parent-map
+ sldb-mode-map
+ slime-inspector-mode-map
+ slime-mode-map
+ slime-popup-buffer-mode-map
+ slime-thread-control-mode-map
+ slime-xref-mode-map))
+
+(defun evil-collection-slime-last-sexp (command &rest args)
+ "In normal-state or motion-state, last sexp ends at point."
+ (if (and (not evil-move-beyond-eol)
+ (or (evil-normal-state-p) (evil-motion-state-p)))
+ (save-excursion
+ (unless (or (eobp) (eolp)) (forward-char))
+ (apply command args))
+ (apply command args)))
+
+;;;###autoload
+(defun evil-collection-slime-setup ()
+ "Set up `evil' bindings for `slime'."
+ (unless evil-move-beyond-eol
+ (advice-add 'slime-eval-last-expression :around 'evil-collection-slime-last-sexp)
+ (advice-add 'slime-pprint-eval-last-expression :around 'evil-collection-slime-last-sexp)
+ (advice-add 'slime-eval-print-last-expression :around 'evil-collection-slime-last-sexp)
+ (advice-add 'slime-eval-last-expression-in-repl
+ :around 'evil-collection-slime-last-sexp))
+
+ (evil-set-initial-state 'sldb-mode 'normal)
+ (evil-set-initial-state 'slime-inspector-mode 'normal)
+ (evil-set-initial-state 'slime-popup-buffer-mode 'normal)
+ (evil-set-initial-state 'slime-thread-control-mode 'normal)
+ (evil-set-initial-state 'slime-xref-mode 'normal)
+
+ (evil-collection-define-key 'normal 'slime-parent-map
+ "gd" 'slime-edit-definition
+ (kbd "C-t") 'slime-pop-find-definition-stack)
+
+ (evil-collection-define-key 'normal 'sldb-mode-map
+ (kbd "RET") 'sldb-default-action
+ [mouse-2] 'sldb-default-action/mouse
+ [follow-link] 'mouse-face
+ "\C-i" 'sldb-cycle
+ "g?" 'describe-mode
+ "S" 'sldb-show-source
+ "e" 'sldb-eval-in-frame
+ "d" 'sldb-pprint-eval-in-frame
+ "D" 'sldb-disassemble
+ "i" 'sldb-inspect-in-frame
+ "gj" 'sldb-down
+ "gk" 'sldb-up
+ (kbd "C-j") 'sldb-down
+ (kbd "C-k") 'sldb-up
+ "]]" 'sldb-details-down
+ "[[" 'sldb-details-up
+ (kbd "M-j") 'sldb-details-down
+ (kbd "M-k") 'sldb-details-up
+ "gg" 'sldb-beginning-of-backtrace
+ "G" 'sldb-end-of-backtrace
+ "t" 'sldb-toggle-details
+ "gr" 'sldb-restart-frame
+ "I" 'sldb-invoke-restart-by-name
+ "R" 'sldb-return-from-frame
+ "c" 'sldb-continue
+ "s" 'sldb-step
+ "n" 'sldb-next
+ "o" 'sldb-out
+ "b" 'sldb-break-on-return
+ "a" 'sldb-abort
+ "q" 'sldb-quit
+ "A" 'sldb-break-with-system-debugger
+ "B" 'sldb-break-with-default-debugger
+ "P" 'sldb-print-condition
+ "C" 'sldb-inspect-condition
+ "g:" 'slime-interactive-eval
+ "0" 'sldb-invoke-restart-0
+ "1" 'sldb-invoke-restart-1
+ "2" 'sldb-invoke-restart-2
+ "3" 'sldb-invoke-restart-3
+ "4" 'sldb-invoke-restart-4
+ "5" 'sldb-invoke-restart-5
+ "6" 'sldb-invoke-restart-6
+ "7" 'sldb-invoke-restart-7
+ "8" 'sldb-invoke-restart-8
+ "9" 'sldb-invoke-restart-9)
+
+ (evil-collection-define-key 'normal 'slime-inspector-mode-map
+ (kbd "RET") 'slime-inspector-operate-on-point
+ [mouse-1] 'slime-inspector-operate-on-click
+ [mouse-2] 'slime-inspector-operate-on-click
+ [mouse-6] 'slime-inspector-pop
+ [mouse-7] 'slime-inspector-next
+ ;; TODO: `slime-inspector-next' and `slime-inspector-pop' should probably
+ ;; just be bound to C-i and C-o.
+ "gk" 'slime-inspector-pop
+ (kbd "C-k") 'slime-inspector-pop
+ "[[" 'slime-inspector-pop
+ (kbd "C-o") 'slime-inspector-pop
+ "gj" 'slime-inspector-next
+ (kbd "C-j") 'slime-inspector-next
+ "]]" 'slime-inspector-next
+ (kbd "C-i") 'slime-inspector-next
+ "K" 'slime-inspector-describe
+ "p" 'slime-inspector-pprint
+ "e" 'slime-inspector-eval
+ "h" 'slime-inspector-history
+ "gr" 'slime-inspector-reinspect
+ "gv" 'slime-inspector-toggle-verbose
+ (kbd "<tab>") 'slime-inspector-next-inspectable-object
+ (kbd "C-i") 'slime-inspector-next-inspectable-object
+ (kbd "<S-tab>") 'slime-inspector-previous-inspectable-object ; Emacs translates S-TAB
+ (kbd "<backtab>") 'slime-inspector-previous-inspectable-object ; to BACKTAB on X.
+ "." 'slime-inspector-show-source
+ "gR" 'slime-inspector-fetch-all
+ "q" 'slime-inspector-quit)
+
+ (evil-collection-define-key 'normal 'slime-mode-map
+ (kbd "K") 'slime-describe-symbol
+ (kbd "C-t") 'slime-pop-find-definition-stack
+ ;; goto
+ "gd" 'slime-edit-definition
+ "gz" 'slime-switch-to-output-buffer)
+
+ (evil-collection-define-key 'normal 'slime-popup-buffer-mode-map
+ ;; quit
+ "q" 'quit-window
+
+ (kbd "C-t") 'slime-pop-find-definition-stack
+
+ ;; goto
+ "gd" 'slime-edit-definition)
+
+ (evil-collection-inhibit-insert-state 'slime-thread-control-mode-map)
+ (evil-collection-define-key 'normal 'slime-thread-control-mode-map
+ "a" 'slime-thread-attach
+ "d" 'slime-thread-debug
+ "x" 'slime-thread-kill
+ "gr" 'slime-update-threads-buffer)
+
+ (evil-collection-define-key 'normal 'slime-xref-mode-map
+ (kbd "RET") 'slime-goto-xref
+ (kbd "S-<return>") 'slime-goto-xref
+ "go" 'slime-show-xref
+ "gj" 'slime-xref-next-line
+ "gk" 'slime-xref-prev-line
+ (kbd "C-j") 'slime-xref-next-line
+ (kbd "C-k") 'slime-xref-prev-line
+ "]]" 'slime-xref-next-line
+ "[[" 'slime-xref-prev-line
+ "gr" 'slime-recompile-xref
+ "gR" 'slime-recompile-all-xrefs
+ "r" 'slime-xref-retract)
+
+ (evil-collection-define-key 'normal 'slime-repl-mode-map
+ "gj" 'slime-repl-next-prompt
+ "gk" 'slime-repl-previous-prompt
+ (kbd "C-j") 'slime-repl-next-prompt
+ (kbd "C-k") 'slime-repl-previous-prompt
+ "]]" 'slime-repl-next-prompt
+ "[[" 'slime-repl-previous-prompt
+ (kbd "C-p") 'slime-repl-previous-input
+ (kbd "C-n") 'slime-repl-next-input)
+
+ (add-hook 'slime-popup-buffer-mode-hook #'evil-normalize-keymaps))
+
+(provide 'evil-collection-slime)
+;;; evil-collection-slime.el ends here
diff --git a/modes/term/evil-collection-term.el b/modes/term/evil-collection-term.el
new file mode 100644
index 0000000..740b7f7
--- /dev/null
+++ b/modes/term/evil-collection-term.el
@@ -0,0 +1,167 @@
+;;; evil-collection-term.el --- Evil bindings for term and ansi-term -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, term, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil integration for `term' and `ansi-term'.
+;; This should also work for other terminal emulators such as `multi-term'.
+;;
+;; Switching to normal state will automatically switch to line mode.
+;; Conversely, switching to insert state will automatically switch to char mode.
+
+;;; Code:
+(require 'evil-collection)
+(require 'term)
+
+(defcustom evil-collection-term-sync-state-and-mode-p t
+ "Synchronize insert/normal state with char/line-mode respectively.
+
+When non-nil, going to normal state will automatically switch to
+line-mode. Conversely, going to insert state on the last
+commandline will automatically switch to char-mode.
+
+Warning: This feature is experimental."
+ :group 'evil-collection-term
+ :type 'boolean)
+
+(defcustom evil-collection-term-sync-state-function
+ 'evil-collection-term-switch-to-char-mode-on-insert
+ "Function used when synchronizing insert/normal state with char/line-mode.
+
+This is only used if `evil-collection-term-sync-state-and-mode-p' is true."
+ :group 'evil-collection-term
+ :type 'function)
+
+;; TODO: Rebinding ESC has the drawback that programs like vi cannot use it anymore.
+;; Workaround: switch to Emacs state and double-press ESC.
+;; Otherwise leave ESC to "C-c C-j".
+;; Or bind char-mode ESC to "C-c C-x"?
+
+;; TODO: Add support for normal-state editing.
+
+(defconst evil-collection-term-maps '(term-raw-map
+ term-mode-map))
+
+(defun evil-collection-term-escape-stay ()
+ "Go back to normal state but don't move cursor backwards.
+Moving cursor backwards is the default Vim behavior but
+it is not appropriate in some cases like terminals."
+ (setq-local evil-move-cursor-back nil))
+
+(defun evil-collection-term-char-mode-insert ()
+ "Switch to `term-char-mode' and enter insert state."
+ (interactive)
+ (term-char-mode)
+ (evil-insert-state))
+
+(defun evil-collection-term-char-mode-entry-function ()
+ "Maybe switch to `term-char-mode' on insert state."
+ (when (get-buffer-process (current-buffer))
+ (let (last-prompt)
+ (save-excursion
+ (goto-char (point-max))
+ (when (= (line-beginning-position) (line-end-position))
+ (ignore-errors (backward-char)))
+ (setq last-prompt (max (term-bol nil) (line-beginning-position))))
+ (when (>= (point) last-prompt)
+ (term-char-mode)))))
+
+(defun evil-collection-term-switch-to-char-mode-on-insert ()
+ "Switch to `term-char-mode' on insert state."
+ (when (get-buffer-process (current-buffer))
+ (term-char-mode)))
+
+(defun evil-collection-term-sync-state-and-mode ()
+ "Sync `term-char-mode' and `term-line-mode' with insert and normal state."
+ (add-hook 'evil-insert-state-entry-hook
+ evil-collection-term-sync-state-function nil t)
+ (add-hook 'evil-insert-state-exit-hook 'term-line-mode nil t))
+
+(defun evil-collection-term-send-tab ()
+ "Send tab in term mode."
+ (interactive)
+ (term-send-raw-string "\t"))
+
+;;;###autoload
+(defun evil-collection-term-setup ()
+ "Set up `evil' bindings for `term'."
+ (evil-set-initial-state 'term-mode 'insert)
+ (if evil-collection-term-sync-state-and-mode-p
+ (add-hook 'term-mode-hook 'evil-collection-term-sync-state-and-mode)
+ (remove-hook 'term-mode-hook 'evil-collection-term-sync-state-and-mode))
+
+ (add-hook 'term-mode-hook 'evil-collection-term-escape-stay)
+
+ ;; Evil has some "C-" bindings in insert state that shadow regular terminal
+ ;; bindings. Don't raw-send "C-c" (prefix key) nor "C-h" (help prefix).
+ (evil-collection-define-key 'insert 'term-raw-map
+ (kbd "C-a") 'term-send-raw
+ (kbd "C-b") 'term-send-raw ; Should not be necessary.
+ (kbd "C-d") 'term-send-raw
+ (kbd "C-e") 'term-send-raw
+ (kbd "C-f") 'term-send-raw ; Should not be necessary.
+ (kbd "C-k") 'term-send-raw
+ (kbd "C-l") 'term-send-raw ; Should not be necessary.
+ (kbd "C-n") 'term-send-raw
+ (kbd "C-o") 'term-send-raw
+ (kbd "C-p") 'term-send-raw
+ (kbd "C-q") 'term-send-raw ; Should not be necessary.
+ (kbd "C-r") 'term-send-raw
+ (kbd "C-s") 'term-send-raw ; Should not be necessary.
+ (kbd "C-t") 'term-send-raw
+ (kbd "C-u") 'term-send-raw ; Should not be necessary.
+ (kbd "C-v") 'term-send-raw ; Should not be necessary.
+ (kbd "C-w") 'term-send-raw
+ (kbd "C-y") 'term-send-raw
+ (kbd "C-z") 'term-send-raw
+ (kbd "<tab>") 'evil-collection-term-send-tab ; Should not be necessary.
+ (kbd "C-c C-d") 'term-send-eof
+ (kbd "C-c C-z") 'term-stop-subjob)
+
+ (evil-collection-define-key 'normal 'term-mode-map
+ (kbd "C-c C-k") 'evil-collection-term-char-mode-insert
+ (kbd "RET") 'term-send-input
+
+ (kbd "p") 'term-paste
+
+ ;; motion
+ "[[" 'term-previous-prompt
+ "]]" 'term-next-prompt
+ (kbd "C-k") 'term-previous-prompt
+ (kbd "C-j") 'term-next-prompt
+ "gk" 'term-previous-prompt
+ "gj" 'term-next-prompt
+ ;; "0" 'term-bol ; "0" is meant to really go at the beginning of line.
+ "^" 'term-bol
+ "$" 'term-show-maximum-output)
+
+ ;; https://github.com/emacs-evil/evil-collection/issues/235
+ (with-eval-after-load 'multi-term
+ (evil-collection-define-key 'normal 'term-mode-map
+ (kbd "<M-backspace>") 'term-send-backward-kill-word)
+ (evil-collection-define-key 'insert 'term-raw-map
+ (kbd "<M-backspace>") 'term-send-backward-kill-word)))
+
+(provide 'evil-collection-term)
+;;; evil-collection-term.el ends here
diff --git a/modes/tide/evil-collection-tide.el b/modes/tide/evil-collection-tide.el
new file mode 100644
index 0000000..c7644e4
--- /dev/null
+++ b/modes/tide/evil-collection-tide.el
@@ -0,0 +1,64 @@
+;;; evil-collection-tide.el --- Bindings for `tide-mode'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, tide, typescript, languages
+
+;; 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:
+;;; Bindings for `tide-mode'.
+
+;;; Code:
+(require 'tide nil t)
+(require 'evil-collection)
+
+(defconst evil-collection-tide-maps '(tide-mode-map
+ tide-references-mode-map
+ tide-project-errors-mode-map))
+
+;;;###autoload
+(defun evil-collection-tide-setup ()
+ "Set up `evil' bindings for `tide'."
+ (evil-collection-define-key 'normal 'tide-mode-map
+ "gd" 'tide-jump-to-definition
+ (kbd "C-t") 'tide-jump-back
+ "K" 'tide-documentation-at-point)
+
+ (evil-collection-define-key 'normal 'tide-references-mode-map
+ "gj" 'tide-find-next-reference
+ "gk" 'tide-find-previous-reference
+ (kbd "C-j") 'tide-find-next-reference
+ (kbd "C-k") 'tide-find-previous-reference
+ (kbd "RET") 'tide-goto-reference
+ ;; quit
+ "q" 'quit-window)
+
+ (evil-collection-define-key 'normal 'tide-project-errors-mode-map
+ "gj" 'tide-find-next-error
+ "gk" 'tide-find-previous-error
+ (kbd "C-j") 'tide-find-next-error
+ (kbd "C-k") 'tide-find-previous-error
+ (kbd "RET") 'tide-goto-error
+ ;; quit
+ (kbd "q") 'quit-window))
+
+(provide 'evil-collection-tide)
+;;; evil-collection-tide.el ends here
diff --git a/modes/transmission/evil-collection-transmission.el b/modes/transmission/evil-collection-transmission.el
new file mode 100644
index 0000000..21b9f9e
--- /dev/null
+++ b/modes/transmission/evil-collection-transmission.el
@@ -0,0 +1,173 @@
+;;; evil-collection-transmission.el --- Evil bindings for transmission.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, transmission, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+
+;;; Commentary:
+;; Evil bindings for `transmission'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'transmission nil t)
+
+(defvar transmission-mode-map)
+(defvar transmission-files-mode-map)
+(defvar transmission-info-mode-map)
+(defvar transmission-peers-mode-map)
+
+(defconst evil-collection-transmission-maps '(transmission-mode-map
+ transmission-files-mode-map
+ transmission-info-mode-map
+ transmission-peers-mode-map))
+
+;;;###autoload
+(defun evil-collection-transmission-setup ()
+ "Set up `evil' bindings for `transmission'."
+
+ (evil-collection-inhibit-insert-state 'transmission-mode-map)
+ (evil-set-initial-state 'transmission-mode 'normal)
+ (evil-collection-define-key 'normal 'transmission-mode-map
+ ;; motion
+ (kbd "SPC") 'scroll-up-command
+ (kbd "S-SPC") 'scroll-down-command
+ (kbd "<delete>") 'scroll-down-command
+
+ ;; sort
+ "o" 'tabulated-list-sort
+
+ (kbd "RET") 'transmission-files
+ "p" 'transmission-peers
+ "i" 'transmission-info
+
+ "a" 'transmission-add
+ ;; "D" 'transmission-delete ; Useless with `transmission-remove'?
+ "r" 'transmission-move
+ "D" 'transmission-remove
+ "x" 'transmission-toggle ; EMMS has "x" for pause.
+ "t" 'transmission-trackers-add
+ "c" 'transmission-verify ; "c" for "[c]heck".
+ "d" 'transmission-set-download
+ "u" 'transmission-set-upload
+ "S" 'transmission-set-ratio ; "S" for "[S]eed"
+ "P" 'transmission-set-bandwidth-priority
+
+ ;; mark
+ "m" 'transmission-toggle-mark
+ "U" 'transmission-unmark-all
+ "~" 'transmission-invert-marks
+
+ ;; refresh
+ "gr" 'revert-buffer
+
+ ;; quit
+ "q" 'transmission-quit
+ "ZQ" 'evil-quit
+ "ZZ" 'transmission-quit)
+
+ (evil-collection-inhibit-insert-state 'transmission-files-mode-map)
+ (evil-set-initial-state 'transmission-files-mode 'normal)
+ (evil-collection-define-key 'normal 'transmission-files-mode-map
+ (kbd "SPC") 'scroll-up-command
+ (kbd "S-SPC") 'scroll-down-command
+ (kbd "<delete>") 'scroll-down-command
+
+ ;; sort
+ "o" 'tabulated-list-sort
+
+ "p" 'transmission-peers
+ "i" 'transmission-info
+
+ "r" 'transmission-move
+ "P" 'transmission-files-priority
+
+ ;; mark
+ "u" 'transmission-files-unwant
+ "m" 'transmission-files-want
+
+ ;; open
+ (kbd "RET") 'transmission-find-file
+ (kbd "S-<return>") 'transmission-find-file-other-window
+ (kbd "M-<return>") 'transmission-display-file
+ "go" 'transmission-find-file-other-window
+
+ "v" 'transmission-view-file
+
+ "!" 'transmission-files-command
+ ;; "X" 'transmission-files-command
+ "t" 'transmission-trackers-add
+ "T" 'transmission-trackers-remove
+
+ ;; goto URL
+ "gx" 'transmission-browse-url-of-file ; See mu4e.
+
+ ;; quit
+ "q" 'transmission-quit
+ "ZQ" 'evil-quit
+ "ZZ" 'transmission-quit)
+
+ (evil-collection-inhibit-insert-state 'transmission-info-mode-map)
+ (evil-set-initial-state 'transmission-info-mode 'normal)
+ (evil-collection-define-key 'normal 'transmission-info-mode-map
+ "p" 'transmission-peers
+
+ "t" 'transmission-trackers-add
+ "T" 'transmission-trackers-remove
+ "D" 'transmission-set-torrent-download
+ "U" 'transmission-set-torrent-upload
+ "S" 'transmission-set-torrent-ratio ; "S" for "[S]eed"
+ "P" 'transmission-set-bandwidth-priority
+ "r" 'transmission-move
+
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'evil-quit
+ "ZZ" 'quit-window)
+
+ (evil-collection-define-key 'operator 'transmission-info-mode-map
+ ;; Like `eww'.
+ "u" '(menu-item
+ ""
+ nil
+ :filter (lambda (&optional _)
+ (when (memq evil-this-operator
+ evil-collection-yank-operators)
+ (setq evil-inhibit-operator t)
+ #'transmission-copy-magnet))))
+
+
+ (evil-collection-inhibit-insert-state 'transmission-peers-mode-map)
+ (evil-set-initial-state 'transmission-peers-mode 'normal)
+ (evil-collection-define-key 'normal 'transmission-peers-mode-map
+ ;; sort
+ "o" 'tabulated-list-sort
+
+ "i" 'transmission-info
+
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'evil-quit
+ "ZZ" 'quit-window))
+
+(provide 'evil-collection-transmission)
+;;; evil-collection-transmission.el ends here
diff --git a/modes/typescript-mode/evil-collection-typescript-mode.el b/modes/typescript-mode/evil-collection-typescript-mode.el
new file mode 100644
index 0000000..32af9cb
--- /dev/null
+++ b/modes/typescript-mode/evil-collection-typescript-mode.el
@@ -0,0 +1,46 @@
+;;; evil-collection-typescript-mode.el --- Bindings for `typescript-mode'. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: emacs, evil, tools, typescript
+
+;; 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:
+;;; Bindings for `typescript-mode'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'typescript-mode nil t)
+
+(defvar typescript-indent-level)
+
+(defun evil-collection-typescript-mode-set-evil-shift-width ()
+ "Set `evil-shift-width' according to `typescript-indent-level'."
+ (setq evil-shift-width typescript-indent-level))
+
+;;;###autoload
+(defun evil-collection-typescript-mode-setup ()
+ "Set up `evil' bindings for `typescript-mode'."
+ (add-hook 'typescript-mode-hook
+ #'evil-collection-typescript-mode-set-evil-shift-width))
+
+(provide 'evil-collection-typescript-mode)
+;;; evil-collection-typescript-mode.el ends here
diff --git a/modes/vc-annotate/evil-collection-vc-annotate.el b/modes/vc-annotate/evil-collection-vc-annotate.el
new file mode 100644
index 0000000..5731caa
--- /dev/null
+++ b/modes/vc-annotate/evil-collection-vc-annotate.el
@@ -0,0 +1,59 @@
+;;; evil-collection-vc-annotate.el --- Bindings for `vc-annotate' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;; Bindings for `vc-annotate'
+
+;;; Code:
+(require 'evil-collection)
+(require 'vc-annotate)
+
+(defconst evil-collection-vc-annotate-maps '(vc-annotate-mode-map))
+
+;;;###autoload
+(defun evil-collection-vc-annotate-setup ()
+ "Set up `evil' bindings for `vc-annotate'."
+ (evil-set-initial-state 'vc-annotate-mode 'normal)
+ (evil-collection-define-key 'normal 'vc-annotate-mode-map
+ "q" 'quit-window
+ "a" 'vc-annotate-revision-previous-to-line
+ "d" 'vc-annotate-show-diff-revision-at-line
+ "=" 'vc-annotate-show-diff-revision-at-line
+ "D" 'vc-annotate-show-changeset-diff-revision-at-line
+ "F" 'vc-annotate-find-revision-at-line
+ "J" 'vc-annotate-revision-at-line
+ "L" 'vc-annotate-show-log-revision-at-line
+ "gj" 'vc-annotate-next-revision
+ "gk" 'vc-annotate-prev-revision
+ "]]" 'vc-annotate-next-revision
+ "[[" 'vc-annotate-prev-revision
+ (kbd "C-j") 'vc-annotate-next-revision
+ (kbd "C-k") 'vc-annotate-prev-revision
+ "W" 'vc-annotate-working-revision
+ "A" 'vc-annotate-toggle-annotation-visibility
+ (kbd "RET") 'vc-annotate-goto-line))
+
+(provide 'evil-collection-vc-annotate)
+;;; evil-collection-vc-annotate.el ends here
diff --git a/modes/vc-git/evil-collection-vc-git.el b/modes/vc-git/evil-collection-vc-git.el
new file mode 100644
index 0000000..146491f
--- /dev/null
+++ b/modes/vc-git/evil-collection-vc-git.el
@@ -0,0 +1,41 @@
+;;; evil-collection-vc-git.el --- Evil bindings for Vc-Git -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <ambrevar@gmail.com>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, vc-git, tools
+
+;; 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:
+;; Evil bindings for Vc-Git.
+
+;;; Code:
+(require 'vc-git)
+(require 'evil-collection)
+
+(defconst evil-collection-vc-git-maps '(vc-git-mode-map))
+
+;;;###autoload
+(defun evil-collection-vc-git-setup ()
+ "Set up `evil' bindings for `vc-git'."
+ (evil-set-initial-state 'vc-git-log-view-mode 'normal))
+
+(provide 'evil-collection-vc-git)
+;;; evil-collection-vc-git.el ends here
diff --git a/modes/vdiff/evil-collection-vdiff.el b/modes/vdiff/evil-collection-vdiff.el
new file mode 100644
index 0000000..0641fb8
--- /dev/null
+++ b/modes/vdiff/evil-collection-vdiff.el
@@ -0,0 +1,60 @@
+;;; evil-collection-vdiff.el --- Evil bindings for vdiff -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Evgeni Kolev <evgenysw@gmail.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, vdiff, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for vdiff.el https://github.com/justbur/emacs-vdiff
+
+;;; Code:
+(require 'vdiff nil t)
+(require 'evil-collection)
+
+;;;###autoload
+(defun evil-collection-vdiff-setup ()
+ "Set up `evil' bindings for `vdiff-mode'."
+ (dolist (mode '(vdiff-mode vdiff-3way-mode))
+ (evil-define-minor-mode-key 'normal mode
+ "]c" 'vdiff-next-hunk
+ "[c" 'vdiff-previous-hunk)
+
+ ;; define `do' (diff obtain) and `dp' (diff put) bindings
+ (evil-define-minor-mode-key 'operator mode
+ "o" '(menu-item
+ ""
+ nil
+ :filter (lambda (&optional _)
+ (when (memq evil-this-operator
+ evil-collection-delete-operators)
+ #'vdiff-receive-changes)))
+ "p" '(menu-item
+ ""
+ nil
+ :filter (lambda (&optional _)
+ (when (memq evil-this-operator
+ evil-collection-delete-operators)
+ #'vdiff-send-changes))))))
+
+(provide 'evil-collection-vdiff)
+
+;;; evil-collection-vdiff.el ends here
diff --git a/modes/view/evil-collection-view.el b/modes/view/evil-collection-view.el
new file mode 100644
index 0000000..6903dd0
--- /dev/null
+++ b/modes/view/evil-collection-view.el
@@ -0,0 +1,55 @@
+;;; evil-collection-view.el --- Evil bindings for view. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2018 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, bindings, tools
+
+;; 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:
+;; Evil bindings for View.
+
+;;; Code:
+(require 'evil-collection)
+(require 'view)
+
+(defconst evil-collection-view-maps '(view-mode-map))
+
+;;;###autoload
+(defun evil-collection-view-setup ()
+ "Set up `evil' bindings for `view'."
+ (add-hook 'view-mode-hook 'evil-normalize-keymaps)
+ (evil-set-initial-state 'view-mode 'normal)
+ (evil-collection-define-key 'normal 'view-mode-map
+ "q" 'quit-window
+ (kbd "SPC") 'View-scroll-page-forward
+ (kbd "S-SPC") 'View-scroll-page-backward
+
+ ;; zoom
+ "+" 'text-scale-increase
+ "=" 'text-scale-increase
+ "0" 'text-scale-adjust ; TODO: Conflicts with `evil-beginning-of-line'.
+ "-" 'text-scale-decrease
+
+ ;; refresh
+ (kbd "gr") 'revert-buffer))
+
+(provide 'evil-collection-view)
+;;; evil-collection-view.el ends here
diff --git a/modes/vlf/evil-collection-vlf.el b/modes/vlf/evil-collection-vlf.el
new file mode 100644
index 0000000..1ab4d45
--- /dev/null
+++ b/modes/vlf/evil-collection-vlf.el
@@ -0,0 +1,78 @@
+;;; evil-collection-vlf.el --- Evil bindings for vlf -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, vlf, tools
+
+;; 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:
+;; Evil bindings for `vlf'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'vlf nil t)
+
+(defvar vlf-mode-map)
+(declare-function vlf-change-batch-size "vlf")
+
+(defconst evil-collection-vlf-maps '(vlf-mode-map))
+
+(defun evil-collection-vlf-decrease-batch-size ()
+ "Decrease vlf batch size by factor of 2."
+ (interactive)
+ (vlf-change-batch-size t))
+
+;;; Code:
+;;;###autoload
+(defun evil-collection-vlf-setup ()
+ "Set up `evil' bindings for `vlf'."
+ (evil-set-initial-state 'vlf-mode 'normal)
+
+ (evil-collection-define-key 'normal 'vlf-mode-map
+ "gj" 'vlf-next-batch
+ "gk" 'vlf-prev-batch
+ (kbd "C-j") 'vlf-next-batch
+ (kbd "C-k") 'vlf-prev-batch
+ "]]" 'vlf-next-batch
+ "[[" 'vlf-prev-batch
+
+ "+" 'vlf-change-batch-size
+ "-" 'evil-collection-vlf-decrease-batch-size
+ "=" 'vlf-next-batch-from-point
+
+ ;; refresh
+ "gr" 'vlf-revert
+
+ "s" 'vlf-re-search-forward
+ "S" 'vlf-re-search-backward
+
+ "gg" 'vlf-beginning-of-file
+ "G" 'vlf-end-of-file
+ "J" 'vlf-jump-to-chunk
+ "E" 'vlf-ediff-buffers
+
+ "g%" 'vlf-query-replace
+ "go" 'vlf-occur
+ "L" 'vlf-goto-line
+ "F" 'vlf-toggle-follow))
+
+(provide 'evil-collection-vlf)
+;;; evil-collection-vlf.el ends here
diff --git a/modes/wdired/evil-collection-wdired.el b/modes/wdired/evil-collection-wdired.el
new file mode 100644
index 0000000..f6064e0
--- /dev/null
+++ b/modes/wdired/evil-collection-wdired.el
@@ -0,0 +1,49 @@
+;;; evil-collection-wdired.el --- Bindings for `wdired' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2018 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;; Bindings for `wdired'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'wdired)
+
+(defconst evil-collection-wdired-maps '(wdired-mode-map))
+
+;;;###autoload
+(defun evil-collection-wdired-setup ()
+ "Set up `evil' bindings for `wdired'."
+ (evil-set-initial-state 'wdired-mode 'normal)
+
+ (evil-collection-define-key nil 'wdired-mode-map
+ [remap evil-write] 'wdired-finish-edit)
+
+ (evil-collection-define-key 'normal 'wdired-mode-map
+ "ZQ" 'wdired-abort-changes
+ "ZZ" 'wdired-finish-edit
+ (kbd "<escape>") 'wdired-exit))
+
+(provide 'evil-collection-wdired)
+;;; evil-collection-wdired.el ends here
diff --git a/modes/wgrep/evil-collection-wgrep.el b/modes/wgrep/evil-collection-wgrep.el
new file mode 100644
index 0000000..a1ff503
--- /dev/null
+++ b/modes/wgrep/evil-collection-wgrep.el
@@ -0,0 +1,49 @@
+;;; evil-collection-wgrep.el --- Bindings for `wgrep' -*- lexical-binding: t -*-
+
+;; Copyright (C) 2018 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, emacs, tools
+
+;; 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:
+;; Bindings for `wgrep'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'wgrep nil t)
+
+(defvar wgrep-mode-map)
+
+(defconst evil-collection-wgrep-maps '(wgrep-mode-map))
+
+;;;###autoload
+(defun evil-collection-wgrep-setup ()
+ "Set up `evil' bindings for `wgrep'."
+ (evil-collection-define-key nil 'wgrep-mode-map
+ [remap evil-write] 'wgrep-finish-edit)
+
+ (evil-collection-define-key 'normal 'wgrep-mode-map
+ "ZQ" 'wgrep-abort-changes
+ "ZZ" 'wgrep-finish-edit
+ (kbd "<escape>") 'wgrep-exit))
+
+(provide 'evil-collection-wgrep)
+;;; evil-collection-wgrep.el ends here
diff --git a/modes/which-key/evil-collection-which-key.el b/modes/which-key/evil-collection-which-key.el
new file mode 100644
index 0000000..89110d0
--- /dev/null
+++ b/modes/which-key/evil-collection-which-key.el
@@ -0,0 +1,52 @@
+;;; evil-collection-which-key.el --- Evil bindings for which-key -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Maximiliano Sandoval <msandova@protonmail.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, which-key, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for `which-key'
+
+;;; Code:
+
+(require 'evil-collection)
+(require 'which-key nil t)
+
+(defvar which-key-C-h-map)
+
+(defconst evil-collection-which-key-maps '(which-key-C-h-map))
+
+;; `which-key'is coded so that the prompt properly shows j and k as
+;; the bindings.
+;;;###autoload
+(defun evil-collection-which-key-setup ()
+ "Set up `evil' bindings for `which-key'."
+
+ ;; (evil-collection-define-key nil 'which-key-C-h-map "u" 'which-key-undo-key)
+ (evil-collection-define-key nil 'which-key-C-h-map
+ "q" 'which-key-abort
+ "j" 'which-key-show-next-page-cycle
+ "k" 'which-key-show-previous-page-cycle
+ "?" 'which-key-show-standard-help))
+
+(provide 'evil-collection-which-key)
+;;; evil-collection-which-key.el ends here
diff --git a/modes/woman/evil-collection-woman.el b/modes/woman/evil-collection-woman.el
new file mode 100644
index 0000000..8759292
--- /dev/null
+++ b/modes/woman/evil-collection-woman.el
@@ -0,0 +1,51 @@
+;;; evil-collection-woman.el --- Evil bindings for WoMan -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, woman, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for `woman'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'evil-collection-man) ; WoMan's keymap inherits from Man.
+(require 'woman)
+
+(defconst evil-collection-woman-maps '(woman-mode-map))
+
+;;;###autoload
+(defun evil-collection-woman-setup ()
+ "Set up `evil' bindings for `woman'."
+ (evil-set-initial-state 'woman-mode 'normal)
+ (evil-collection-define-key 'normal 'woman-mode-map
+ (kbd "]]") 'WoMan-next-manpage
+ (kbd "[[") 'WoMan-previous-manpage
+
+ ;; goto
+ ;; "gm" 'woman
+
+ ;; refresh
+ "gr" 'woman-reformat-last-file))
+
+(provide 'evil-collection-woman)
+;;; evil-collection-woman.el ends here
diff --git a/modes/xref/evil-collection-xref.el b/modes/xref/evil-collection-xref.el
new file mode 100644
index 0000000..f704759
--- /dev/null
+++ b/modes/xref/evil-collection-xref.el
@@ -0,0 +1,58 @@
+;;; evil-collection-xref.el --- Evil bindings for xref -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 James Nguyen
+
+;; Author: James Nguyen <james@jojojames.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, xref, tools
+
+;; 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:
+;; Evil bindings for `xref'.
+
+;;; Code:
+(require 'evil-collection)
+(require 'xref)
+
+(defconst evil-collection-xref-maps '(xref--xref-buffer-mode-map))
+
+;;;###autoload
+(defun evil-collection-xref-setup ()
+ "Set up `evil' bindings for `xref'."
+ (evil-collection-define-key 'normal 'xref--xref-buffer-mode-map
+ "q" 'quit-window
+ "gj" 'xref-next-line
+ "gk" 'xref-prev-line
+ (kbd "C-j") 'xref-next-line
+ (kbd "C-k") 'xref-prev-line
+ "]]" 'xref-next-line
+ "[[" 'xref-prev-line
+ "r" 'xref-query-replace-in-results
+
+ ;; Match `dired''s `dired-do-find-regexp-and-replace'.
+ "Q" 'xref-query-replace-in-results
+
+ ;; open
+ (kbd "RET") 'xref-goto-xref
+ (kbd "S-<return>") 'xref-show-location-at-point
+ "o" 'xref-show-location-at-point
+ "go" 'xref-show-location-at-point))
+
+(provide 'evil-collection-xref)
+;;; evil-collection-xref.el ends here
diff --git a/modes/ztree/evil-collection-ztree.el b/modes/ztree/evil-collection-ztree.el
new file mode 100644
index 0000000..ba48b25
--- /dev/null
+++ b/modes/ztree/evil-collection-ztree.el
@@ -0,0 +1,73 @@
+;;; evil-collection-ztree.el --- Evil bindings for ztree -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 Pierre Neidhardt
+
+;; Author: Pierre Neidhardt <mail@ambrevar.xyz>
+;; Maintainer: James Nguyen <james@jojojames.com>, Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, ztree, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for ztree.
+
+;;; Code:
+(require 'evil-collection)
+(require 'ztree nil t)
+
+(defvar ztree-mode-map)
+(defvar ztreediff-mode-map)
+
+(defconst evil-collection-ztree-maps '(ztree-mode-map ztreediff-mode-map))
+
+;;;###autoload
+(defun evil-collection-ztree-setup ()
+ "Set up `evil' bindings for `ztree'."
+
+ (evil-collection-inhibit-insert-state 'ztree-mode-map)
+ (evil-set-initial-state 'ztree-mode 'normal)
+ (evil-collection-define-key 'normal 'ztree-mode-map
+ (kbd "<tab>") 'ztree-jump-side
+ (kbd "RET") 'ztree-perform-action
+ (kbd "SPC") 'ztree-perform-soft-action
+
+ "x" 'ztree-toggle-expand-subtree
+
+ ;; refresh
+ "gr" 'ztree-refresh-buffer
+
+ ;; quit
+ "q" 'quit-window
+ "ZQ" 'quit-window
+ "ZZ" 'quit-window)
+
+ (evil-collection-inhibit-insert-state 'ztreediff-mode-map)
+ (evil-set-initial-state 'ztree-mode 'normal)
+ (evil-define-minor-mode-key 'normal 'ztreediff-mode
+ "C" 'ztree-diff-copy
+ "D" 'ztree-diff-delete-file
+ "zH" 'ztree-diff-toggle-show-filtered-files
+ "d" 'ztree-diff-simple-diff-files
+ "zh" 'ztree-diff-toggle-show-equal-files
+ "gf" 'ztree-diff-view-file
+
+ ;; refresh
+ "gr" 'ztree-diff-partial-rescan
+ "gR" 'ztree-diff-full-rescan))
+
+(provide 'evil-collection-ztree)
+;;; evil-collection-ztree.el ends here