From 9eb7d3db0d4b7ffbc6ea6c137b0f2ec21f907d53 Mon Sep 17 00:00:00 2001 From: James Nguyen Date: Wed, 6 Dec 2017 17:41:09 -0800 Subject: Change namespace to evil-collection --- evil-ag.el | 58 ---------- evil-alchemist.el | 102 ------------------ evil-anaconda-mode.el | 56 ---------- evil-arc-mode.el | 74 ------------- evil-bookmark.el | 73 ------------- evil-calendar.el | 101 ------------------ evil-cider.el | 112 ------------------- evil-collection-ag.el | 58 ++++++++++ evil-collection-alchemist.el | 102 ++++++++++++++++++ evil-collection-anaconda-mode.el | 56 ++++++++++ evil-collection-arc-mode.el | 74 +++++++++++++ evil-collection-bookmark.el | 73 +++++++++++++ evil-collection-calendar.el | 101 ++++++++++++++++++ evil-collection-cider.el | 112 +++++++++++++++++++ evil-collection-comint.el | 52 +++++++++ evil-collection-company.el | 76 +++++++++++++ evil-collection-compile.el | 58 ++++++++++ evil-collection-cus-theme.el | 61 +++++++++++ evil-collection-custom.el | 65 +++++++++++ evil-collection-debbugs.el | 73 +++++++++++++ evil-collection-debug.el | 63 +++++++++++ evil-collection-diff-mode.el | 142 ++++++++++++++++++++++++ evil-collection-dired.el | 192 +++++++++++++++++++++++++++++++++ evil-collection-doc-view.el | 80 ++++++++++++++ evil-collection-edebug.el | 111 +++++++++++++++++++ evil-collection-elfeed.el | 97 +++++++++++++++++ evil-collection-elisp-mode.el | 77 ++++++++++++++ evil-collection-elisp-refs.el | 49 +++++++++ evil-collection-emms.el | 193 +++++++++++++++++++++++++++++++++ evil-collection-eshell.el | 94 ++++++++++++++++ evil-collection-eval-sexp-fu.el | 59 ++++++++++ evil-collection-flycheck.el | 53 +++++++++ evil-collection-geiser.el | 90 ++++++++++++++++ evil-collection-ggtags.el | 94 ++++++++++++++++ evil-collection-helm.el | 81 ++++++++++++++ evil-collection-help.el | 66 ++++++++++++ evil-collection-ibuffer.el | 54 ++++++++++ evil-collection-image+.el | 49 +++++++++ evil-collection-image.el | 90 ++++++++++++++++ evil-collection-info.el | 77 ++++++++++++++ evil-collection-ivy.el | 79 ++++++++++++++ evil-collection-macrostep.el | 49 +++++++++ evil-collection-man.el | 64 +++++++++++ evil-collection-minibuffer.el | 70 ++++++++++++ evil-collection-occur.el | 70 ++++++++++++ evil-collection-outline.el | 82 ++++++++++++++ evil-collection-p4.el | 55 ++++++++++ evil-collection-package-menu.el | 53 +++++++++ evil-collection-pass.el | 57 ++++++++++ evil-collection-pdf.el | 225 +++++++++++++++++++++++++++++++++++++++ evil-collection-proced.el | 88 +++++++++++++++ evil-collection-prodigy.el | 76 +++++++++++++ evil-collection-profiler.el | 69 ++++++++++++ evil-collection-rtags.el | 136 +++++++++++++++++++++++ evil-collection-slime.el | 105 ++++++++++++++++++ evil-collection-term.el | 127 ++++++++++++++++++++++ evil-collection-tide.el | 61 +++++++++++ evil-collection-transmission.el | 144 +++++++++++++++++++++++++ evil-collection-util.el | 6 +- evil-collection-vlf.el | 75 +++++++++++++ evil-collection-woman.el | 47 ++++++++ evil-collection-xref.el | 52 +++++++++ evil-collection-ztree.el | 64 +++++++++++ evil-collection.el | 8 +- evil-comint.el | 52 --------- evil-company.el | 76 ------------- evil-compile.el | 58 ---------- evil-cus-theme.el | 61 ----------- evil-custom.el | 65 ----------- evil-debbugs.el | 73 ------------- evil-debug.el | 63 ----------- evil-diff-mode.el | 142 ------------------------ evil-dired.el | 192 --------------------------------- evil-doc-view.el | 80 -------------- evil-edebug.el | 111 ------------------- evil-elfeed.el | 97 ----------------- evil-elisp-mode.el | 77 -------------- evil-elisp-refs.el | 49 --------- evil-emms.el | 193 --------------------------------- evil-eshell.el | 94 ---------------- evil-eval-sexp-fu.el | 59 ---------- evil-flycheck.el | 53 --------- evil-geiser.el | 90 ---------------- evil-ggtags.el | 94 ---------------- evil-helm.el | 81 -------------- evil-help.el | 66 ------------ evil-ibuffer.el | 54 ---------- evil-image+.el | 49 --------- evil-image.el | 90 ---------------- evil-info.el | 77 -------------- evil-ivy.el | 79 -------------- evil-macrostep.el | 49 --------- evil-man.el | 64 ----------- evil-minibuffer.el | 70 ------------ evil-occur.el | 70 ------------ evil-outline.el | 82 -------------- evil-p4.el | 55 ---------- evil-package-menu.el | 53 --------- evil-pass.el | 57 ---------- evil-pdf.el | 225 --------------------------------------- evil-proced.el | 88 --------------- evil-prodigy.el | 76 ------------- evil-profiler.el | 69 ------------ evil-rtags.el | 136 ----------------------- evil-slime.el | 105 ------------------ evil-term.el | 127 ---------------------- evil-tide.el | 61 ----------- evil-transmission.el | 144 ------------------------- evil-vlf.el | 75 ------------- evil-woman.el | 47 -------- evil-xref.el | 52 --------- evil-ztree.el | 64 ----------- readme.org | 6 +- test/evil-collection-test.el | 8 -- test/evilcol-test.el | 8 ++ 115 files changed, 4638 insertions(+), 4638 deletions(-) delete mode 100644 evil-ag.el delete mode 100644 evil-alchemist.el delete mode 100644 evil-anaconda-mode.el delete mode 100644 evil-arc-mode.el delete mode 100644 evil-bookmark.el delete mode 100644 evil-calendar.el delete mode 100644 evil-cider.el create mode 100644 evil-collection-ag.el create mode 100644 evil-collection-alchemist.el create mode 100644 evil-collection-anaconda-mode.el create mode 100644 evil-collection-arc-mode.el create mode 100644 evil-collection-bookmark.el create mode 100644 evil-collection-calendar.el create mode 100644 evil-collection-cider.el create mode 100644 evil-collection-comint.el create mode 100644 evil-collection-company.el create mode 100644 evil-collection-compile.el create mode 100644 evil-collection-cus-theme.el create mode 100644 evil-collection-custom.el create mode 100644 evil-collection-debbugs.el create mode 100644 evil-collection-debug.el create mode 100644 evil-collection-diff-mode.el create mode 100644 evil-collection-dired.el create mode 100644 evil-collection-doc-view.el create mode 100644 evil-collection-edebug.el create mode 100644 evil-collection-elfeed.el create mode 100644 evil-collection-elisp-mode.el create mode 100644 evil-collection-elisp-refs.el create mode 100644 evil-collection-emms.el create mode 100644 evil-collection-eshell.el create mode 100644 evil-collection-eval-sexp-fu.el create mode 100644 evil-collection-flycheck.el create mode 100644 evil-collection-geiser.el create mode 100644 evil-collection-ggtags.el create mode 100644 evil-collection-helm.el create mode 100644 evil-collection-help.el create mode 100644 evil-collection-ibuffer.el create mode 100644 evil-collection-image+.el create mode 100644 evil-collection-image.el create mode 100644 evil-collection-info.el create mode 100644 evil-collection-ivy.el create mode 100644 evil-collection-macrostep.el create mode 100644 evil-collection-man.el create mode 100644 evil-collection-minibuffer.el create mode 100644 evil-collection-occur.el create mode 100644 evil-collection-outline.el create mode 100644 evil-collection-p4.el create mode 100644 evil-collection-package-menu.el create mode 100644 evil-collection-pass.el create mode 100644 evil-collection-pdf.el create mode 100644 evil-collection-proced.el create mode 100644 evil-collection-prodigy.el create mode 100644 evil-collection-profiler.el create mode 100644 evil-collection-rtags.el create mode 100644 evil-collection-slime.el create mode 100644 evil-collection-term.el create mode 100644 evil-collection-tide.el create mode 100644 evil-collection-transmission.el create mode 100644 evil-collection-vlf.el create mode 100644 evil-collection-woman.el create mode 100644 evil-collection-xref.el create mode 100644 evil-collection-ztree.el delete mode 100644 evil-comint.el delete mode 100644 evil-company.el delete mode 100644 evil-compile.el delete mode 100644 evil-cus-theme.el delete mode 100644 evil-custom.el delete mode 100644 evil-debbugs.el delete mode 100644 evil-debug.el delete mode 100644 evil-diff-mode.el delete mode 100644 evil-dired.el delete mode 100644 evil-doc-view.el delete mode 100644 evil-edebug.el delete mode 100644 evil-elfeed.el delete mode 100644 evil-elisp-mode.el delete mode 100644 evil-elisp-refs.el delete mode 100644 evil-emms.el delete mode 100644 evil-eshell.el delete mode 100644 evil-eval-sexp-fu.el delete mode 100644 evil-flycheck.el delete mode 100644 evil-geiser.el delete mode 100644 evil-ggtags.el delete mode 100644 evil-helm.el delete mode 100644 evil-help.el delete mode 100644 evil-ibuffer.el delete mode 100644 evil-image+.el delete mode 100644 evil-image.el delete mode 100644 evil-info.el delete mode 100644 evil-ivy.el delete mode 100644 evil-macrostep.el delete mode 100644 evil-man.el delete mode 100644 evil-minibuffer.el delete mode 100644 evil-occur.el delete mode 100644 evil-outline.el delete mode 100644 evil-p4.el delete mode 100644 evil-package-menu.el delete mode 100644 evil-pass.el delete mode 100644 evil-pdf.el delete mode 100644 evil-proced.el delete mode 100644 evil-prodigy.el delete mode 100644 evil-profiler.el delete mode 100644 evil-rtags.el delete mode 100644 evil-slime.el delete mode 100644 evil-term.el delete mode 100644 evil-tide.el delete mode 100644 evil-transmission.el delete mode 100644 evil-vlf.el delete mode 100644 evil-woman.el delete mode 100644 evil-xref.el delete mode 100644 evil-ztree.el delete mode 100644 test/evil-collection-test.el create mode 100644 test/evilcol-test.el diff --git a/evil-ag.el b/evil-ag.el deleted file mode 100644 index 02479fd..0000000 --- a/evil-ag.el +++ /dev/null @@ -1,58 +0,0 @@ -;;; evil-ag.el --- Evil Bindings for Ag -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `ag-mode' from the `wgrep-ag' package. - -;;; Code: -(require 'ag nil t) -(require 'evil) - -(defun evil-ag-setup () - "Set up `evil' bindings for `ag'." - (evil-define-key 'normal 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 - "n" 'evil-search-next - "N" '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-ag) -;;; evil-ag.el ends here diff --git a/evil-alchemist.el b/evil-alchemist.el deleted file mode 100644 index 7897e42..0000000 --- a/evil-alchemist.el +++ /dev/null @@ -1,102 +0,0 @@ -;;; evil-alchemist.el --- Bindings for `alchemist'. -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;;; Bindings for `alchemist'. - -;;; Code: -(require 'evil) -(require 'alchemist nil t) - -(defun evil-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-define-key 'normal alchemist-compile-mode-map - "q" 'quit-window) - - (evil-define-key 'normal alchemist-eval-mode-map - "q" 'quit-window) - - (evil-define-key 'normal alchemist-execute-mode-map - "q" 'quit-window) - - (evil-define-key 'normal alchemist-message-mode-map - "q" 'quit-window) - - (evil-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-define-key 'normal alchemist-macroexpand-mode-map - "q" 'quit-window) - - (evil-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-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-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-define-key 'normal alchemist-mode-map - (kbd "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-alchemist) -;;; evil-alchemist.el ends here diff --git a/evil-anaconda-mode.el b/evil-anaconda-mode.el deleted file mode 100644 index a56392e..0000000 --- a/evil-anaconda-mode.el +++ /dev/null @@ -1,56 +0,0 @@ -;;; evil-anaconda-mode.el --- Bindings for `anaconda-mode'. -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;;; Bindings for `anaconda-mode'. - -;;; Code: -(require 'anaconda-mode nil t) -(require 'evil) - -(defun evil-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) - - (evil-define-key 'normal anaconda-mode-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-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") 'anaconda-mode-go-back - "K" 'anaconda-mode-show-doc - "gf" 'anaconda-mode-find-file)) - -(provide 'evil-anaconda-mode) -;;; evil-anaconda-mode.el ends here diff --git a/evil-arc-mode.el b/evil-arc-mode.el deleted file mode 100644 index 24dc239..0000000 --- a/evil-arc-mode.el +++ /dev/null @@ -1,74 +0,0 @@ -;;; evil-arc-mode.el --- Evil bindings for arc-mode. -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;;; Evil bindings for arc-mode. - -;;; Code: -(require 'arc-mode) -(require 'evil) - -(defun evil-arc-mode-setup () - "Set up `evil' bindings for `arc-mode'." - (evil-set-initial-state 'arc-mode 'motion) - (evil-set-initial-state 'archive-mode 'motion) - (evil-define-key 'motion 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 "") 'archive-extract - (kbd "S-") 'archive-extract-other-window - (kbd "M-") '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-arc-mode) -;;; evil-arc-mode.el ends here diff --git a/evil-bookmark.el b/evil-bookmark.el deleted file mode 100644 index 8e97873..0000000 --- a/evil-bookmark.el +++ /dev/null @@ -1,73 +0,0 @@ -;;; evil-bookmark.el --- Evil bindings for bookmarks -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for bookmarks. - -;;; Code: -(require 'bookmark) - -(defun evil-bookmark-setup () - "Set up `evil' bindings for `bookmark'." - (evil-set-initial-state 'bookmark-bmenu-mode 'normal) - - (evil-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 - "u" 'bookmark-bmenu-unmark - "m" 'bookmark-bmenu-mark - "/" '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 - - ;; open - "o" 'bookmark-bmenu-select - "O" 'bookmark-bmenu-other-window - "go" 'bookmark-bmenu-other-window - "gO" 'bookmark-bmenu-switch-other-window - (kbd "") 'bookmark-bmenu-this-window - (kbd "S-") 'bookmark-bmenu-other-window - (kbd "M-") 'bookmark-bmenu-switch-other-window)) - - -(provide 'evil-bookmark) -;;; evil-bookmark.el ends here diff --git a/evil-calendar.el b/evil-calendar.el deleted file mode 100644 index 8e640e1..0000000 --- a/evil-calendar.el +++ /dev/null @@ -1,101 +0,0 @@ -;;; evil-calendar.el --- Evil bindings for calendar -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for the calendar. - -;;; Code: -(require 'calendar) -(require 'evil) - -(defun evil-calendar-setup () - "Set up `evil' bindings for `calendar'." - (evil-define-key 'motion 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 "") '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-calendar) -;;; evil-calendar.el ends here diff --git a/evil-cider.el b/evil-cider.el deleted file mode 100644 index 4423136..0000000 --- a/evil-cider.el +++ /dev/null @@ -1,112 +0,0 @@ -;;; evil-cider.el --- Evil bindings for Cider -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for Cider. - -;;; Code: -(require 'cider nil t) -(require 'evil-collection-util) - -(defun evil-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))) - -(defun evil-cider-setup () - "Set up `evil' bindings for `cider'." - (unless evil-move-beyond-eol - (advice-add 'cider-eval-last-sexp :around 'evil-cider-last-sexp) - (advice-add 'cider-eval-last-sexp-and-replace :around 'evil-cider-last-sexp) - (advice-add 'cider-eval-last-sexp-to-repl :around 'evil-cider-last-sexp) - (with-eval-after-load 'cider-eval-sexp-fu - (advice-add 'cider-esf--bounds-of-last-sexp :around 'evil-cider-last-sexp))) - - (evil-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) - - (with-eval-after-load 'cider-repl - (evil-define-key '(normal visual) cider-repl-mode-map - "gd" 'cider-find-var - (kbd "C-t") 'cider-pop-back - "gr" 'cider-refresh - "gf" 'cider-find-resource - "K" 'cider-doc)) - - (with-eval-after-load 'cider-test - (evil-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 "") 'cider-test-previous-result - (kbd "") 'cider-test-next-result - (kbd "") '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)) - - (with-eval-after-load 'cider-macroexpansion - (evil-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)) - - (with-eval-after-load 'cider-client - (evil-define-key 'normal cider-connections-buffer-mode-map - "d" 'cider-connections-make-default - "c" 'cider-connection-browser - "x" 'cider-connections-close-connection - (kbd "") 'cider-connections-goto-connection - "g?" 'describe-mode))) - -(provide 'evil-cider) -;;; evil-cider.el ends here diff --git a/evil-collection-ag.el b/evil-collection-ag.el new file mode 100644 index 0000000..170cd0a --- /dev/null +++ b/evil-collection-ag.el @@ -0,0 +1,58 @@ +;;; evil-collection-ag.el --- Evil Bindings for Ag -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `ag-mode' from the `wgrep-ag' package. + +;;; Code: +(require 'ag nil t) +(require 'evil) + +(defun evil-collection-ag-setup () + "Set up `evil' bindings for `ag'." + (evil-define-key 'normal 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 + "n" 'evil-search-next + "N" '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/evil-collection-alchemist.el b/evil-collection-alchemist.el new file mode 100644 index 0000000..5ce31e5 --- /dev/null +++ b/evil-collection-alchemist.el @@ -0,0 +1,102 @@ +;;; evil-collection-alchemist.el --- Bindings for `alchemist'. -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;;; Bindings for `alchemist'. + +;;; Code: +(require 'evil) +(require 'alchemist nil t) + +(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-define-key 'normal alchemist-compile-mode-map + "q" 'quit-window) + + (evil-define-key 'normal alchemist-eval-mode-map + "q" 'quit-window) + + (evil-define-key 'normal alchemist-execute-mode-map + "q" 'quit-window) + + (evil-define-key 'normal alchemist-message-mode-map + "q" 'quit-window) + + (evil-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-define-key 'normal alchemist-macroexpand-mode-map + "q" 'quit-window) + + (evil-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-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-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-define-key 'normal alchemist-mode-map + (kbd "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/evil-collection-anaconda-mode.el b/evil-collection-anaconda-mode.el new file mode 100644 index 0000000..a770bc3 --- /dev/null +++ b/evil-collection-anaconda-mode.el @@ -0,0 +1,56 @@ +;;; evil-collection-anaconda-mode.el --- Bindings for `anaconda-mode'. -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;;; Bindings for `anaconda-mode'. + +;;; Code: +(require 'anaconda-mode nil t) +(require 'evil) + +(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) + + (evil-define-key 'normal anaconda-mode-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-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") 'anaconda-mode-go-back + "K" 'anaconda-mode-show-doc + "gf" 'anaconda-mode-find-file)) + +(provide 'evil-collection-anaconda-mode) +;;; evil-collection-anaconda-mode.el ends here diff --git a/evil-collection-arc-mode.el b/evil-collection-arc-mode.el new file mode 100644 index 0000000..51d7dea --- /dev/null +++ b/evil-collection-arc-mode.el @@ -0,0 +1,74 @@ +;;; evil-collection-arc-mode.el --- Evil bindings for arc-mode. -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;;; Evil bindings for arc-mode. + +;;; Code: +(require 'arc-mode) +(require 'evil) + +(defun evil-collection-arc-mode-setup () + "Set up `evil' bindings for `arc-mode'." + (evil-set-initial-state 'arc-mode 'motion) + (evil-set-initial-state 'archive-mode 'motion) + (evil-define-key 'motion 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 "") 'archive-extract + (kbd "S-") 'archive-extract-other-window + (kbd "M-") '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/evil-collection-bookmark.el b/evil-collection-bookmark.el new file mode 100644 index 0000000..5a4f6e0 --- /dev/null +++ b/evil-collection-bookmark.el @@ -0,0 +1,73 @@ +;;; evil-collection-bookmark.el --- Evil bindings for bookmarks -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for bookmarks. + +;;; Code: +(require 'bookmark) + +(defun evil-collection-bookmark-setup () + "Set up `evil' bindings for `bookmark'." + (evil-set-initial-state 'bookmark-bmenu-mode 'normal) + + (evil-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 + "u" 'bookmark-bmenu-unmark + "m" 'bookmark-bmenu-mark + "/" '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 + + ;; open + "o" 'bookmark-bmenu-select + "O" 'bookmark-bmenu-other-window + "go" 'bookmark-bmenu-other-window + "gO" 'bookmark-bmenu-switch-other-window + (kbd "") 'bookmark-bmenu-this-window + (kbd "S-") 'bookmark-bmenu-other-window + (kbd "M-") 'bookmark-bmenu-switch-other-window)) + + +(provide 'evil-collection-bookmark) +;;; evil-collection-bookmark.el ends here diff --git a/evil-collection-calendar.el b/evil-collection-calendar.el new file mode 100644 index 0000000..4aa1859 --- /dev/null +++ b/evil-collection-calendar.el @@ -0,0 +1,101 @@ +;;; evil-collection-calendar.el --- Evil bindings for calendar -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for the calendar. + +;;; Code: +(require 'calendar) +(require 'evil) + +(defun evil-collection-calendar-setup () + "Set up `evil' bindings for `calendar'." + (evil-define-key 'motion 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 "") '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/evil-collection-cider.el b/evil-collection-cider.el new file mode 100644 index 0000000..0a8ca99 --- /dev/null +++ b/evil-collection-cider.el @@ -0,0 +1,112 @@ +;;; evil-collection-cider.el --- Evil bindings for Cider -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for Cider. + +;;; Code: +(require 'cider nil t) +(require 'evil-collection-util) + +(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))) + +(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))) + + (evil-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) + + (with-eval-after-load 'cider-repl + (evil-define-key '(normal visual) cider-repl-mode-map + "gd" 'cider-find-var + (kbd "C-t") 'cider-pop-back + "gr" 'cider-refresh + "gf" 'cider-find-resource + "K" 'cider-doc)) + + (with-eval-after-load 'cider-test + (evil-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 "") 'cider-test-previous-result + (kbd "") 'cider-test-next-result + (kbd "") '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)) + + (with-eval-after-load 'cider-macroexpansion + (evil-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)) + + (with-eval-after-load 'cider-client + (evil-define-key 'normal cider-connections-buffer-mode-map + "d" 'cider-connections-make-default + "c" 'cider-connection-browser + "x" 'cider-connections-close-connection + (kbd "") 'cider-connections-goto-connection + "g?" 'describe-mode))) + +(provide 'evil-collection-cider) +;;; evil-collection-cider.el ends here diff --git a/evil-collection-comint.el b/evil-collection-comint.el new file mode 100644 index 0000000..1409749 --- /dev/null +++ b/evil-collection-comint.el @@ -0,0 +1,52 @@ +;;; evil-collection-comint.el --- Bindings for `comint-mode'. -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;;; Bindings for `comint-mode'. + +;;; Code: +(require 'comint) +(require 'evil) + +(defun evil-collection-comint-setup () + "Set up `evil' bindings for `comint'." + (when evil-want-C-d-scroll + (evil-define-key 'normal comint-mode-map + (kbd "C-d") #'evil-scroll-down)) + + (evil-define-key 'normal comint-mode-map + (kbd "C-j") #'comint-next-input + (kbd "C-k") #'comint-previous-input + (kbd "gj") #'comint-next-input + (kbd "gk") #'comint-previous-input + (kbd "]") #'comint-next-input + (kbd "[") #'comint-previous-input) + + (evil-define-key 'insert comint-mode-map + (kbd "") #'comint-previous-input + (kbd "") #'comint-next-input)) + +(provide 'evil-collection-comint) +;;; evil-collection-comint.el ends here diff --git a/evil-collection-company.el b/evil-collection-company.el new file mode 100644 index 0000000..79f45e9 --- /dev/null +++ b/evil-collection-company.el @@ -0,0 +1,76 @@ +;;; evil-collection-company.el --- Bindings for `company-mode'. -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;;; Bindings for `company-mode'. + +;;; Code: +(require 'company nil t) +(require 'evil) + +(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) + +(defun evil-collection-company-setup () + "Set up `evil' bindings for `company'." + (define-key company-active-map (kbd "C-n") 'company-select-next-or-abort) + (define-key company-active-map (kbd "C-p") 'company-select-previous-or-abort) + (define-key company-active-map (kbd "C-j") 'company-select-next-or-abort) + (define-key company-active-map (kbd "C-k") 'company-select-previous-or-abort) + (define-key company-active-map (kbd "M-j") 'company-select-next) + (define-key company-active-map (kbd "M-k") 'company-select-previous) + + (when evil-want-C-u-scroll + (define-key company-active-map (kbd "C-u") 'company-previous-page)) + + (when evil-want-C-d-scroll + (define-key company-active-map (kbd "C-d") 'company-next-page)) + + (define-key company-search-map (kbd "C-j") 'company-select-next-or-abort) + (define-key company-search-map (kbd "C-k") 'company-select-previous-or-abort) + (define-key company-search-map (kbd "M-j") 'company-select-next) + (define-key company-search-map (kbd "M-k") 'company-select-previous) + + ;; Sets up YCMD like behavior. + (when evil-collection-company-use-tng + (with-no-warnings (company-tng-configure-default)))) + +(provide 'evil-collection-company) +;;; evil-collection-company.el ends here diff --git a/evil-collection-compile.el b/evil-collection-compile.el new file mode 100644 index 0000000..87c12cc --- /dev/null +++ b/evil-collection-compile.el @@ -0,0 +1,58 @@ +;;; evil-collection-compile.el --- Evil bindings for `compile' -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `compile'. + +;;; Code: +(require 'evil-collection-util) +(require 'compile) + +(defun evil-collection-compile-setup () + "Set up `evil' bindings for `compile'." + (evil-set-initial-state 'compilation-mode 'normal) + + (evil-define-key 'normal compilation-mode-map + "g?" 'describe-mode + "?" '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 "") 'compile-goto-error + + "go" 'compilation-display-error + (kbd "S-") '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/evil-collection-cus-theme.el b/evil-collection-cus-theme.el new file mode 100644 index 0000000..3a1aaa9 --- /dev/null +++ b/evil-collection-cus-theme.el @@ -0,0 +1,61 @@ +;;; evil-collection-cus-theme.el --- Bindings for `cus-theme'. -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;;; Bindings for `cus-theme'. + +;;; Code: +(require 'cus-theme) +(require 'evil) + +(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-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-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/evil-collection-custom.el b/evil-collection-custom.el new file mode 100644 index 0000000..870e54a --- /dev/null +++ b/evil-collection-custom.el @@ -0,0 +1,65 @@ +;;; evil-collection-custom.el --- Evil bindings for Customize -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for the Customize interface. + +;;; Code: +(require 'cus-edit) +(require 'evil) + +(defun evil-collection-custom-setup () + "Set up `evil' bindings for `Custom-mode'." + (evil-set-initial-state 'Custom-mode 'normal) + + (evil-define-key 'normal custom-mode-map + ;; motion + (kbd "") 'widget-forward + (kbd "S-") 'widget-backward + (kbd "") 'widget-backward + (kbd "SPC") 'scroll-up-command + (kbd "S-SPC") 'scroll-down-command + (kbd "") 'scroll-down-command + (kbd "") '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/evil-collection-debbugs.el b/evil-collection-debbugs.el new file mode 100644 index 0000000..d27be89 --- /dev/null +++ b/evil-collection-debbugs.el @@ -0,0 +1,73 @@ +;;; evil-collection-debbugs.el --- Evil bindings for debbugs -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for debbugs. + +;;; Code: +(require 'debbugs nil t) +(require 'evil) + +(defun evil-collection-debbugs-mode-setup () + "Set up `evil' bindings for `debbugs-gnu-mode'." + (evil-set-initial-state 'debbugs-gnu-mode 'motion) + + (evil-define-key 'motion debbugs-gnu-mode-map + ;; motion + (kbd "") 'forward-button + (kbd "") 'backward-button + (kbd "SPC") 'scroll-up-command + + (kbd "") 'debbugs-gnu-select-report + "c" 'debbugs-gnu-send-control-message + "d" 'debbugs-gnu-display-status + + ;; filter + (kbd "s") 'debbugs-gnu-narrow-to-status + ;; "S" 'debbugs-gnu-widen ; Useless if we can just press "s RET" (empty filter). + "S" '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 + + ;; quit + "q" 'quit-window + "ZQ" 'quit-window + "ZZ" 'quit-window)) + +(provide 'evil-collection-debbugs) +;;; evil-collection-debbugs.el ends here diff --git a/evil-collection-debug.el b/evil-collection-debug.el new file mode 100644 index 0000000..8d21ceb --- /dev/null +++ b/evil-collection-debug.el @@ -0,0 +1,63 @@ +;;; evil-collection-debug.el --- Evil bindings for the debugger -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for the debugger. + +;;; Code: + +(require 'evil) +(require 'debug) + +(defun evil-collection-debug-setup () + "Set up `evil' bindings for `debug'." + (evil-set-initial-state 'debugger-mode 'motion) + + (evil-define-key 'motion debugger-mode-map + ;; motion + (kbd "") 'forward-button + (kbd "S-") 'backward-button + (kbd "") 'debug-help-follow + (kbd "SPC") 'next-line + + "R" 'debugger-record-expression + "c" 'debugger-continue + "d" 'debugger-step-through + "x" 'debugger-eval-expression + "J" 'debugger-jump + + "gl" 'debugger-list-functions + "gb" 'debugger-frame + "r" 'debugger-return-value + "u" 'debugger-frame-clear + "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/evil-collection-diff-mode.el b/evil-collection-diff-mode.el new file mode 100644 index 0000000..29d9bc3 --- /dev/null +++ b/evil-collection-diff-mode.el @@ -0,0 +1,142 @@ +;;; evil-collection-diff-mode.el --- Add Evil bindings to diff-mode -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; 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) +(require 'diff-mode) + +(defun evil-collection-diff-read-only-state-switch () + "Make read-only in motion state, writable in normal state." + (if buffer-read-only + (progn + (evil-motion-state) + (message "Evil Diff: enter motion state")) + (evil-normal-state) + (message "Evil Diff: enter normal state"))) + +(defun evil-collection-diff-toggle-setup () + "Toggle visiting diff buffers in motion state." + (interactive) + (when (eq major-mode 'diff-mode) + (if (memq 'evil-diff-read-only-state-switch read-only-mode-hook) + (remove-hook 'read-only-mode-hook 'evil-diff-read-only-state-switch t) + (add-hook 'read-only-mode-hook 'evil-diff-read-only-state-switch nil t) + (read-only-mode)))) + +;;; 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))) + +(defun evil-collection-diff-mode-setup () + "Set up `evil' bindings for `diff-mode'." + + (evil-set-initial-state 'diff-mode 'motion) + + (evil-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 + + "\\" 'read-only-mode) ; magit has "\" + + (evil-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 "") '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-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/evil-collection-dired.el b/evil-collection-dired.el new file mode 100644 index 0000000..9ff4153 --- /dev/null +++ b/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 +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for Dired. + +;;; Code: +(require 'dired) +(require 'evil-collection-util) + +(defun evil-collection-dired-setup () + "Set up `evil' bindings for `dired'." + (evil-define-key 'normal dired-mode-map + "g" nil + "q" 'quit-window + "j" 'dired-next-line + "k" 'dired-previous-line + "l" 'evil-forward-char + "h" 'evil-backward-char + ":" 'evil-ex + "w" 'evil-forward-word-begin + "e" 'evil-forward-word-end + "y" 'evil-yank + "f" 'evil-find-char + "v" 'evil-visual-char + "G" 'evil-goto-line + "$" 'evil-end-of-line + "n" 'evil-search-next + [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 + "*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 "* ") '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-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 "") 'dired-find-file + (kbd "S-") 'dired-find-file-other-window + (kbd "M-") 'dired-display-file + "go" 'dired-find-file-other-window + "gO" 'dired-view-file + ;; sort + "o" 'dired-sort-toggle-or-edit + ;; moving + "<" 'dired-prev-dirline + ">" 'dired-next-dirline + "^" '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 "") '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/evil-collection-doc-view.el b/evil-collection-doc-view.el new file mode 100644 index 0000000..dac75f0 --- /dev/null +++ b/evil-collection-doc-view.el @@ -0,0 +1,80 @@ +;;; evil-collection-doc-view.el --- Evil bindings for docview. -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;;; Evil bindings for doc-view. + +;;; Code: +(require 'evil) +(require 'doc-view) + +(defun evil-collection-doc-view-setup () + "Set up `evil' bindings for `doc-view'." + (evil-set-initial-state 'doc-view-mode 'motion) + (evil-define-key 'motion doc-view-mode-map + (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 "") '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-define-key 'motion doc-view-mode-map + (kbd "C-u") 'backward-page))) + +(provide 'evil-collection-doc-view) +;;; evil-collection-doc-view.el ends here diff --git a/evil-collection-edebug.el b/evil-collection-edebug.el new file mode 100644 index 0000000..45d1459 --- /dev/null +++ b/evil-collection-edebug.el @@ -0,0 +1,111 @@ +;;; evil-collection-edebug.el --- Evil bindings for Edebug -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `edebug-mode'. + +;;; Code: +(require 'edebug) +(require 'evil-collection-util) + +(evil-collection-util-set-initial-state edebug-mode motion) + +(defun evil-collection-edebug-setup () + "Set up `evil' bindings for `edebug'." + (evil-define-key 'motion edebug-mode-map + ;; control + " " nil + "s" 'edebug-step-mode + "n" 'edebug-next-mode + "go" 'edebug-go-mode + "gn" '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 + "EE" '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-define-key 'motion edebug-x-instrumented-function-list-mode-map + "E" 'edebug-x-evaluate-function + "Q" 'edebug-x-clear-data + (kbd "") 'edebug-x-find-function + "q" 'quit-window) + (evil-define-key 'motion edebug-x-breakpoint-list-mode-map + (kbd "") '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/evil-collection-elfeed.el b/evil-collection-elfeed.el new file mode 100644 index 0000000..0eb7dd2 --- /dev/null +++ b/evil-collection-elfeed.el @@ -0,0 +1,97 @@ +;;; evil-collection-elfeed.el --- Evil bindings for elfeed -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for elfeed. + +;;; Code: +(require 'elfeed nil t) +(require 'evil) + +(defun evil-collection-elfeed-setup () + "Set up `evil' bindings for `elfeed'." + (evil-set-initial-state 'elfeed-search-mode 'motion) + + (evil-define-key 'motion elfeed-search-mode-map + ;; open + (kbd "") 'elfeed-search-show-entry + (kbd "S-") 'elfeed-search-browse-url + "go" 'elfeed-search-browse-url + + "y" 'elfeed-search-yank + + ;; 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-define-key '(motion 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-set-initial-state 'elfeed-show-mode 'motion) + (evil-define-key 'motion elfeed-show-mode-map + (kbd "S-") 'elfeed-show-visit + "go" 'elfeed-show-visit + + ;; filter + "s" 'elfeed-show-new-live-search + + "y" 'elfeed-show-yank + + "+" '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)) + +(provide 'evil-collection-elfeed) +;;; evil-collection-elfeed.el ends here diff --git a/evil-collection-elisp-mode.el b/evil-collection-elisp-mode.el new file mode 100644 index 0000000..6aa7b9f --- /dev/null +++ b/evil-collection-elisp-mode.el @@ -0,0 +1,77 @@ +;;; evil-collection-elisp-mode.el --- Bindings for `elisp-mode'. -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;;; Bindings for `elisp-mode'. + +;;; Code: +(require 'elisp-mode) +(require 'evil) + +(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))) + +(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-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/evil-collection-elisp-refs.el b/evil-collection-elisp-refs.el new file mode 100644 index 0000000..34f0e69 --- /dev/null +++ b/evil-collection-elisp-refs.el @@ -0,0 +1,49 @@ +;;; evil-collection-elisp-refs.el --- Evil bindings for Elisp Refs -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; This package provides a sane set of defaults for `elisp-refs' when using +;; `evil-mode'. + +;;; Code: +(require 'evil-collection-util) +(require 'elisp-refs nil t) + +(defun evil-collection-elisp-refs-setup () + "Set up `evil' bindings for `elisp-refs'." + (evil-define-key 'normal elisp-refs-mode-map + (kbd "") 'elisp-refs-next-match + (kbd "") '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 "") 'elisp-refs-visit-match + + ;; quit + "q" 'kill-this-buffer)) + +(provide 'evil-collection-elisp-refs) +;;; evil-collection-elisp-refs.el ends here diff --git a/evil-collection-emms.el b/evil-collection-emms.el new file mode 100644 index 0000000..652a5ca --- /dev/null +++ b/evil-collection-emms.el @@ -0,0 +1,193 @@ +;;; evil-collection-emms.el --- Evil bindings for EMMS -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for EMMS. + +;;; Code: +(require 'emms nil t) +(require 'evil) + +(defvar emms-browser-mode-map) +(defvar emms-playlist-mode-map) + +;;; TODO: Make all playback bindings consistent across modes: +;;; - stop +;;; - pause +;;; - volume +;;; - next/previous +;;; - fast-forward/backward + +;;; TODO: Add bindings to emms-browser-search-mode-map. + +;;; emms-browser does not run any mode hook. As such the default state is 'normal. +;;; TODO: Report upstream. +(defun evil-collection-emms-browser () + "Default `emms-browser' to motion state." + (evil-motion-state)) + +(with-no-warnings + (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) + (evil-next-line) + (evil-emms-playlist-mode-paste-before))) + +(defun evil-collection-emms-setup () + "Set up `evil' bindings for `emms'." + (advice-add 'emms-browser :after 'evil-emms-browser) + (evil-set-initial-state 'emms-playlist-mode 'motion) + + (with-eval-after-load 'emms-browser + (dolist (map (list emms-browser-mode-map emms-playlist-mode-map)) + (evil-define-key* 'motion map + "+" 'emms-volume-raise + "=" 'emms-volume-raise + "-" 'emms-volume-lower + "u" 'emms-playlist-mode-undo)) + + ;; TODO: Why do we need to define emms-browser-mode-map after load and not emms-playlist-mode-map? + (evil-define-key 'motion emms-browser-mode-map + ;; playback controls + "x" 'emms-pause + "X" 'emms-stop + "r" 'emms-random + "<" 'emms-seek-backward + ">" 'emms-seek-forward + (kbd "") 'emms-browser-add-tracks + (kbd "C-") 'emms-browser-add-tracks-and-play + + ;; motion + "[" 'emms-browser-prev-non-track + "]" 'emms-browser-next-non-track + "gj" 'emms-browser-prev-non-track + "gk" 'emms-browser-next-non-track + + (kbd "") 'emms-browser-toggle-subitems + (kbd "SPC") 'emms-browser-toggle-subitems + ;; TODO: Use S-? + "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 + + "/" 'emms-isearch-buffer ; This shows hidden items during search. + + ;; filter + ;; "" 'emms-browser-previous-filter ; TODO: What does this do? + ;; "" 'emms-browser-next-filter + + "s" (lookup-key emms-browser-mode-map (kbd "s")) + "g" (lookup-key emms-browser-mode-map (kbd "W")) ;; TODO: This overrides other "g-" prefixed keys. + + "C" 'emms-browser-clear-playlist + "D" 'emms-browser-delete-files + "d" 'emms-browser-view-in-dired + "gd" 'emms-playlist-mode-goto-dired-at-point)) ; "d" does the same, keep "gd" for consistency. + + (evil-define-key 'motion 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 "") 'emms-playlist-mode-play-smart + + ;; motion + "gg" 'emms-playlist-mode-first + "G" 'emms-playlist-mode-last + "]" 'emms-playlist-mode-next + "[" 'emms-playlist-mode-previous + "gj" 'emms-playlist-mode-next + "gk" 'emms-playlist-mode-previous + + "D" 'emms-playlist-mode-kill-track ; emms-browser uses "D" + "C" 'emms-playlist-mode-clear + "O" 'evil-collection-evil-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 + "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-define-key 'visual emms-playlist-mode-map + ;; "d" 'emms-playlist-mode-kill + "D" 'emms-playlist-mode-kill)) + +(provide 'evil-collection-emms) +;;; evil-collection-emms.el ends here diff --git a/evil-collection-eshell.el b/evil-collection-eshell.el new file mode 100644 index 0000000..1ce7779 --- /dev/null +++ b/evil-collection-eshell.el @@ -0,0 +1,94 @@ +;;; evil-collection-eshell.el --- Evil bindings for Eshell -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for EMMS + +;;; Code: +(require 'em-prompt) +(require 'eshell) +(require 'evil) + +(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-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-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 "") 'eshell-send-input + (kbd "C-c C-c") 'evil-collection-eshell-interrupt-process) + (evil-define-key 'insert eshell-mode-map + ;; motion + (kbd "M-h") 'eshell-backward-argument + (kbd "M-l") 'eshell-forward-argument) + (evil-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. +(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/evil-collection-eval-sexp-fu.el b/evil-collection-eval-sexp-fu.el new file mode 100644 index 0000000..577dc92 --- /dev/null +++ b/evil-collection-eval-sexp-fu.el @@ -0,0 +1,59 @@ +;;; evil-collection-eval-sexp-fu.el --- Bindings for `eval-sexp-fu'. -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;;; Bindings for `eval-sexp-fu'. + +;;; Code: +(require 'evil) +(with-no-warnings + (require 'eval-sexp-fu nil t)) + +(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)) + +(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/evil-collection-flycheck.el b/evil-collection-flycheck.el new file mode 100644 index 0000000..e091a21 --- /dev/null +++ b/evil-collection-flycheck.el @@ -0,0 +1,53 @@ +;;; evil-collection-flycheck.el --- Evil bindings for flycheck -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `flycheck-mode'. + +;;; Code: +(require 'evil-collection-util) +(require 'flycheck nil t) + +(defvar flycheck-error-list-mode-map) + +(defun evil-collection-flycheck-setup () + "Set up `evil' bindings for `flycheck'." + (evil-set-initial-state 'flycheck-error-list-mode 'normal) + (evil-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 "") 'flycheck-error-list-goto-error + "q" 'quit-window)) + +(provide 'evil-collection-flycheck) +;;; evil-collection-flycheck.el ends here diff --git a/evil-collection-geiser.el b/evil-collection-geiser.el new file mode 100644 index 0000000..4706ed4 --- /dev/null +++ b/evil-collection-geiser.el @@ -0,0 +1,90 @@ +;;; evil-collection-geiser.el --- Bindings for `geiser'. -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;;; Bindings for `geiser'. + +;;; Code: +(require 'evil) +(require 'geiser nil t) + +(defvar geiser-debug-mode-map) +(defvar geiser-doc-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))) + +(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-define-key 'normal geiser-debug-mode-map + "q" 'quit-window) + + (evil-define-key 'normal geiser-doc-mode-map + "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-define-key 'insert geiser-repl-mode-map + (kbd "S-") 'geiser-repl--newline-and-indent) + + (evil-define-key 'normal geiser-repl-mode-map + "gd" 'geiser-edit-symbol-at-point + (kbd "C-t") 'geiser-pop-symbol-stack + (kbd "K") 'geiser-doc-symbol-at-point) + + (evil-define-key 'normal geiser-mode-map + "gd" 'geiser-edit-symbol-at-point + (kbd "C-t") 'geiser-pop-symbol-stack + (kbd "gZ") 'geiser-mode-switch-to-repl-and-enter + (kbd "gz") 'geiser-mode-switch-to-repl + (kbd "K") 'geiser-doc-symbol-at-point)) + +(provide 'evil-collection-geiser) +;;; evil-collection-geiser.el ends here diff --git a/evil-collection-ggtags.el b/evil-collection-ggtags.el new file mode 100644 index 0000000..cbe9ce3 --- /dev/null +++ b/evil-collection-ggtags.el @@ -0,0 +1,94 @@ +;;; evil-collection-ggtags.el --- Evil bindings for ggtags -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `ggtags-mode'. + +;;; Code: +(require 'evil-collection-util) +(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) + +(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-define-key 'normal ggtags-mode-map + "gd" 'ggtags-find-tag-dwim + (kbd "C-t") 'ggtags-prev-mark + "gf" 'ggtags-find-file) + + (evil-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-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-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 "") 'ggtags-navigation-mode-done)) + +(provide 'evil-collection-ggtags) +;;; evil-collection-ggtags.el ends here diff --git a/evil-collection-helm.el b/evil-collection-helm.el new file mode 100644 index 0000000..1e3e039 --- /dev/null +++ b/evil-collection-helm.el @@ -0,0 +1,81 @@ +;;; evil-collection-helm.el --- Evil bindings for Helm -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for Helm. + +;;; Code: +(require 'evil) +(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 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-read-file-map) + +(defun evil-collection-helm-setup () + "Set up `evil' bindings for `helm'." + (evil-define-key '(insert normal) helm-map + (kbd "M-[") 'helm-previous-source + (kbd "M-]") 'helm-next-source + (kbd "M-l") 'helm-execute-persistent-action) + (dolist (map (list helm-find-files-map helm-read-file-map)) + ;; TODO: We should use evil-define-key but it does not seem to work. + (define-key map (kbd "M-h") 'helm-find-files-up-one-level) + (define-key map (kbd "C-l") nil)) ; So the Helm header displays the "M-l" binding. + + (evil-define-key 'normal helm-map + (kbd "[") 'helm-previous-source + (kbd "]") '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 + + ;; refresh + "gr" 'helm-refresh + + "p" 'helm-yank-selection + "P" 'helm-copy-to-buffer + "y" 'helm-kill-selection-and-quit + (kbd "SPC") 'helm-toggle-visible-mark) + + (evil-define-key '(normal insert) helm-map + (kbd "M-j") 'helm-next-line + (kbd "M-k") 'helm-previous-line + (kbd "C-f") 'helm-next-page + (kbd "C-b") 'helm-previous-page)) + +(provide 'evil-collection-helm) +;;; evil-collection-helm.el ends here diff --git a/evil-collection-help.el b/evil-collection-help.el new file mode 100644 index 0000000..ca3c216 --- /dev/null +++ b/evil-collection-help.el @@ -0,0 +1,66 @@ +;;; evil-collection-help.el --- Evil bindings for help-mode -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `help-mode'. + +;;; Code: +(require 'evil) +(require 'help-mode) + +(defun evil-collection-help-setup () + "Set up `evil' bindings for `help'." + (evil-set-initial-state 'help-mode 'normal) + (evil-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 "") 'forward-button + (kbd "") '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 + + "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/evil-collection-ibuffer.el b/evil-collection-ibuffer.el new file mode 100644 index 0000000..bb5e7d5 --- /dev/null +++ b/evil-collection-ibuffer.el @@ -0,0 +1,54 @@ +;;; evil-collection-ibuffer.el --- Evil bindings for IBuffer -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for IBuffer. + +;;; Code: +(require 'evil-collection-util) +(require 'ibuffer) + +(defun evil-collection-ibuffer-setup () + "Set up `evil' bindings for `ibuffer'." + (evil-collection-util-evilify-map + ibuffer-mode-map + :mode ibuffer-mode + :bindings + "gb" 'ibuffer-bury-buffer + "gB" 'ibuffer-copy-buffername-as-kill + "gw" 'ibuffer-copy-filename-as-kill + "gW" 'ibuffer-do-view-and-eval + + ;; refresh + "gr" 'ibuffer-update + + "gx" 'ibuffer-kill-line + (kbd "C-j") 'ibuffer-forward-filter-group + (kbd "C-k") 'ibuffer-backward-filter-group ; Originally `ibuffer-kill-line'. + "gj" 'ibuffer-forward-filter-group + "gk" 'ibuffer-backward-filter-group)) + +(provide 'evil-collection-ibuffer) +;;; evil-collection-ibuffer.el ends here diff --git a/evil-collection-image+.el b/evil-collection-image+.el new file mode 100644 index 0000000..4f3aa58 --- /dev/null +++ b/evil-collection-image+.el @@ -0,0 +1,49 @@ +;;; evil-collection-image+.el --- Evil bindings for image-mode with image+ -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for image-mode with image+. + +;;; Code: +(require 'evil) +(require 'image+ nil t) + +(defun evil-collection-image+-setup () + "Set up `evil' bindings for `image+'." + (evil-define-key 'motion 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 + "l" 'imagex-sticky-rotate-left)) + +(provide 'evil-collection-image+) +;;; evil-collection-image+.el ends here diff --git a/evil-collection-image.el b/evil-collection-image.el new file mode 100644 index 0000000..1a1f54a --- /dev/null +++ b/evil-collection-image.el @@ -0,0 +1,90 @@ +;;; evil-collection-image.el --- Evil bindings for Image -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `image-mode'. + +;;; Code: +(require 'evil) +(require 'image-mode) + +;; TODO: pdf and doc-view conflict with image. +;; See https://github.com/jojojames/evil-collection/issues/23. + +(defun evil-collection-image-setup () + "Set up `evil' bindings for `image-mode'." + (evil-set-initial-state 'image-mode 'motion) + + (evil-define-key 'motion 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-down + (kbd "SPC") 'image-scroll-up + (kbd "S-SPC") 'image-scroll-down + (kbd "") 'image-scroll-down + + ;; animation + (kbd "") '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-define-key 'motion image-mode-map + (kbd "C-u") 'image-scroll-up))) + +(provide 'evil-collection-image) +;;; evil-collection-image.el ends here diff --git a/evil-collection-info.el b/evil-collection-info.el new file mode 100644 index 0000000..9b46455 --- /dev/null +++ b/evil-collection-info.el @@ -0,0 +1,77 @@ +;;; evil-collection-info.el --- Evil bindings for Info-mode -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; The default bindings in motion state override the standard +;; movement keys. This package restores them. + +;;; Code: +(require 'evil) +(require 'info) + +(defun evil-collection-info-setup () + "Set up `evil' bindings for `info-mode'." + (evil-define-key 'motion Info-mode-map + ;; motion: Restore some Evil keys that got overriden. + "w" 'evil-forward-word-begin + "e" 'evil-forward-word-end + "ge" 'evil-backward-word-end + "gE" 'evil-backward-WORD-end + "b" 'evil-backward-word-begin + "gg" 'evil-goto-first-line + "t" 'evil-find-char-to + "T" 'evil-find-char-to-backward + "f" 'evil-find-char + "n" 'evil-search-next + "?" 'evil-search-backward + (kbd "") 'Info-next-reference + (kbd "S-") 'Info-prev-reference + + ;; TODO: Should search with "n"/"N" cover the full manual like "C-s"/"C-r" does? + + ;; goto + "gd" 'Info-goto-node ; TODO: "gd" does not match the rationale of "go to definition". Change? + "gt" 'Info-top-node + "gT" 'Info-toc + "gf" 'Info-follow-reference + (kbd "C-o") 'Info-history-back + (kbd "C-i") 'Info-history-forward + ;; 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 + + (kbd "M-w") 'Info-copy-current-node-name ; TODO: Use yn? + "p" nil + + ;; quit + "q" 'Info-exit + "ZQ" 'evil-quit + "ZZ" 'Info-exit)) + +(provide 'evil-collection-info) +;;; evil-collection-info.el ends here diff --git a/evil-collection-ivy.el b/evil-collection-ivy.el new file mode 100644 index 0000000..32dff8b --- /dev/null +++ b/evil-collection-ivy.el @@ -0,0 +1,79 @@ +;;; evil-collection-ivy.el --- Evil bindings for ivy -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `ivy-mode'. + +;;; Code: +(require 'evil) +(require 'ivy nil t) + +(defun evil-collection-ivy-setup () + "Set up `evil' bindings for `ivy-mode'." + (evil-define-key 'normal ivy-occur-mode-map + [mouse-1] 'ivy-occur-click + (kbd "") 'ivy-occur-press-and-switch + (kbd "j") 'ivy-occur-next-line + (kbd "k") 'ivy-occur-previous-line + (kbd "h") 'evil-backward-char + (kbd "l") 'evil-forward-char + (kbd "g") nil + (kbd "gg") 'evil-goto-first-line + (kbd "gf") 'ivy-occur-press + (kbd "gr") 'ivy-occur-revert-buffer + (kbd "ga") 'ivy-occur-read-action + (kbd "go") 'ivy-occur-dispatch + (kbd "gc") 'ivy-occur-toggle-calling + + ;; quit + (kbd "q") 'quit-window) + + (when evil-want-C-d-scroll + (evil-define-key 'normal ivy-occur-grep-mode-map + "D" 'ivy-occur-delete-candidate + (kbd "C-d") 'evil-scroll-down)) + + (evil-define-key 'normal ivy-occur-grep-mode-map + (kbd "C-x C-q") 'ivy-wgrep-change-to-wgrep-mode + "gd" 'ivy-occur-delete-candidate + [mouse-1] 'ivy-occur-click + (kbd "") '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 + + ;; quit + (kbd "q") 'quit-window)) + +(provide 'evil-collection-ivy) +;;; evil-collection-ivy.el ends here diff --git a/evil-collection-macrostep.el b/evil-collection-macrostep.el new file mode 100644 index 0000000..c34fac7 --- /dev/null +++ b/evil-collection-macrostep.el @@ -0,0 +1,49 @@ +;;; evil-collection-macrostep.el --- Evil Integration for Macrostep -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `macrostep-mode'. + +;;; Code: +(require 'evil-collection-util) +(require 'macrostep nil t) + +(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-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/evil-collection-man.el b/evil-collection-man.el new file mode 100644 index 0000000..89f97cb --- /dev/null +++ b/evil-collection-man.el @@ -0,0 +1,64 @@ +;;; evil-collection-man.el --- Evil bindings for Man-mode -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `man'. + +;;; Code: +(require 'evil) +(require 'man) + +(defun evil-collection-man-setup () + "Set up `evil' bindings for `man'." + (evil-define-key 'motion Man-mode-map + ;; motion + (kbd "SPC") 'scroll-up-command + (kbd "S-SPC") 'scroll-down-command + (kbd "") 'forward-button + (kbd "") '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" 'Man-quit + "ZQ" 'evil-quit + "ZZ" 'Man-quit)) + +(provide 'evil-collection-man) +;;; evil-collection-man.el ends here diff --git a/evil-collection-minibuffer.el b/evil-collection-minibuffer.el new file mode 100644 index 0000000..4e16269 --- /dev/null +++ b/evil-collection-minibuffer.el @@ -0,0 +1,70 @@ +;;; evil-collection-minibuffer.el --- Evil bindings for the minibuffer -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for the minibuffer. + +;;; Code: +(require 'evil) + +(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)) + +(defun evil-collection-minibuffer-init () + "Initialize minibuffer for `evil'." + ;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-from-Minibuffer.html + ;; WARNING: With lexical binding, lambdas from `mapc' and `dolist' become + ;; closures in which we must use `evil-define-key*' instead of + ;; `evil-define-key'. + (dolist (map (list minibuffer-local-map + minibuffer-local-ns-map + minibuffer-local-completion-map + minibuffer-local-must-match-map + minibuffer-local-isearch-map)) + (evil-define-key* 'normal map (kbd "") 'abort-recursive-edit) + (evil-define-key* 'normal map (kbd "") 'exit-minibuffer)) + (add-hook 'minibuffer-setup-hook 'evil-minibuffer-insert) + ;; Because of the above minibuffer-setup-hook, some evil-ex bindings need be reset. + (evil-define-key 'normal evil-ex-completion-map (kbd "") 'abort-recursive-edit) + (evil-define-key 'insert evil-ex-completion-map (kbd "C-p") 'previous-complete-history-element) + (evil-define-key 'insert evil-ex-completion-map (kbd "C-n") 'next-complete-history-element) + (evil-define-key 'normal evil-ex-completion-map (kbd "C-p") 'previous-history-element) + (evil-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/evil-collection-occur.el b/evil-collection-occur.el new file mode 100644 index 0000000..996d9c8 --- /dev/null +++ b/evil-collection-occur.el @@ -0,0 +1,70 @@ +;;; evil-collection-occur.el --- Evil bindings for occur -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `occur'. + +;;; Code: +(require 'evil-collection-util) + +(when (> emacs-major-version 25) + (require 'replace)) + +(defun evil-collection-occur-setup () + "Set up `evil' bindings for `occur'." + (evil-set-initial-state 'occur-mode 'normal) + + (evil-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 "") 'occur-mode-goto-occurrence + (kbd "S-") 'occur-mode-goto-occurrence-other-window + (kbd "M-") '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-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/evil-collection-outline.el b/evil-collection-outline.el new file mode 100644 index 0000000..411d046 --- /dev/null +++ b/evil-collection-outline.el @@ -0,0 +1,82 @@ +;;; evil-collection-outline.el --- Evil bindings for outline-mode -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for outline-mode. + +;;; Code: +(require 'evil) +(require 'outline) + +(defun evil-collection-outline-setup () + "Set up `evil' bindings for `outline'." + (evil-define-key 'motion 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. + (kbd "S-") 'outline-show-all ; Also "z r" by default + (kbd "") 'outline-toggle-children ; Also "z a" by default + ;; "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". + + "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 + "^" 'outline-up-heading + + (kbd "M-h") 'outline-move-demote ; Org-mode has "M-", Evil-org has "M-h" + (kbd "M-j") 'outline-move-subtree-down ; Org-mode has "M-", Evil-org has "M-j" + (kbd "M-k") 'outline-move-subtree-up ; Org-mode has "M-", Evil-org has "M-k" + (kbd "M-l") 'outline-move-promote ; Org-mode has "M-", Evil-org has "M-l" + + (kbd "M-") 'outline-insert-heading)) ; Org-mode has "M-" + +(provide 'evil-collection-outline) +;;; evil-collection-outline.el ends here diff --git a/evil-collection-p4.el b/evil-collection-p4.el new file mode 100644 index 0000000..bb5e9d7 --- /dev/null +++ b/evil-collection-p4.el @@ -0,0 +1,55 @@ +;;; evil-collection-p4.el --- Evil bindings for P4 -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for P4. + +;;; Code: +(require 'p4 nil t) + +(defvar p4-basic-mode-map) + +(defun evil-collection-p4-setup () + "Set up `evil' bindings for `p4'." + (evil-set-initial-state 'p4-basic-mode 'normal) + + (evil-define-key 'normal p4-basic-mode-map + [mouse-1] 'p4-buffer-mouse-clicked + "k" 'p4-scroll-down-1-line + "j" 'p4-scroll-up-1-line + (kbd "C-j") 'p4-forward-active-link + (kbd "C-k") 'p4-backward-active-link + (kbd "") '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)) + +;;; Code: +(provide 'evil-collection-p4) +;;; evil-collection-p4.el ends here diff --git a/evil-collection-package-menu.el b/evil-collection-package-menu.el new file mode 100644 index 0000000..4b8a628 --- /dev/null +++ b/evil-collection-package-menu.el @@ -0,0 +1,53 @@ +;;; evil-collection-package-menu.el --- Evil bindings for package-menu -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil integration for `package-menu-mode'. + +;;; Code: +(require 'evil) +(require 'package) + +(defun evil-collection-package-menu-setup () + "Set up `evil' bindings for `package-menu'." + (evil-set-initial-state 'package-menu-mode 'motion) + + (evil-define-key 'motion package-menu-mode-map + "i" 'package-menu-mark-install + "U" 'package-menu-mark-upgrades + "d" 'package-menu-mark-delete + + ;; undo + "u" 'package-menu-mark-unmark + + ;; execute + "x" 'package-menu-execute + + ;; "q" 'quit-window ; macros can make sense here. + "ZQ" 'evil-quit + "ZZ" 'quit-window)) + +(provide 'evil-collection-package-menu) +;;; evil-collection-package-menu.el ends here diff --git a/evil-collection-pass.el b/evil-collection-pass.el new file mode 100644 index 0000000..2dc2eec --- /dev/null +++ b/evil-collection-pass.el @@ -0,0 +1,57 @@ +;;; evil-collection-pass.el --- Evil bindings for pass-mode -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `pass-mode'. + +;;; Code: +(require 'evil-collection-util) +(require 'pass nil t) + +(defvar pass-mode-map) + +(defun evil-collection-pass-setup () + "Set up `evil' bindings for `pass-mode'." + (evil-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 + "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/evil-collection-pdf.el b/evil-collection-pdf.el new file mode 100644 index 0000000..cc813b4 --- /dev/null +++ b/evil-collection-pdf.el @@ -0,0 +1,225 @@ +;;; evil-collection-pdf.el --- Evil bindings for pdf-tools -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for pdf-tools. + +;;; Code: +(require 'evil) +(require 'pdf-view nil t) + +(with-no-warnings + (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))) + + (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)))) + +(defun evil-collection-pdf-setup () + "Set up `evil' bindings for `pdf-view'." + (evil-set-initial-state 'pdf-view-mode 'motion) + (evil-define-key 'motion pdf-view-mode-map + ;; motion + (kbd "") 'image-next-line + "j" 'pdf-view-next-line-or-next-page + "k" '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 "") '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 "") 'forward-page + (kbd "") 'backward-page + (kbd "") 'pdf-view-next-line-or-next-page + (kbd "") '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 + "-" 'pdf-view-shrink + "0" 'pdf-view-scale-reset + "=" 'pdf-view-enlarge + + ;; 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 "") 'pdf-view-mouse-extend-region + (kbd "") 'pdf-view-mouse-set-region-rectangle + (kbd "") 'pdf-view-mouse-set-region + + (kbd "C-c C-c") 'docview-mode + (kbd "C-c ") '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 + + "y" 'pdf-view-kill-ring-save + + ;; search + (kbd "M-s o") 'pdf-occur ; TODO: More Evil bindings? + + "zd" 'pdf-view-dark-minor-mode + "zm" 'pdf-view-midnight-minor-mode + "zp" 'pdf-view-printer-minor-mode + + ;; quit + "q" 'quit-window + "Q" 'kill-this-buffer + "ZQ" 'kill-this-buffer + "ZZ" 'quit-window) + + (evil-set-initial-state 'pdf-outline-buffer-mode 'motion) + (evil-define-key 'motion pdf-outline-buffer-mode-map + ;; open + (kbd "") 'pdf-outline-follow-link-and-quit + (kbd "S-") 'pdf-outline-follow-link + (kbd "M-") '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-define-key 'motion pdf-occur-buffer-mode-map + ;; open + (kbd "") 'pdf-occur-goto-occurrence + (kbd "S-") '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 + "M" '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 "") 'tablist-unmark-backward + (kbd "S-SPC") 'scroll-down-command + (kbd "") 'tablist-backward-column + (kbd "C-c C-e") 'tablist-export-csv + + [remap evil-first-non-blank] 'tablist-move-to-major-columnj + [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/evil-collection-proced.el b/evil-collection-proced.el new file mode 100644 index 0000000..67ca8e0 --- /dev/null +++ b/evil-collection-proced.el @@ -0,0 +1,88 @@ +;;; evil-collection-proced.el --- Evil bindings for proced -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for proced. + +;;; Code: +(require 'evil) +(require 'proced) + +(defun evil-collection-proced-setup () + (evil-set-initial-state 'proced-mode 'motion) + + (evil-define-key 'motion proced-mode-map + (kbd "") 'proced-refine + + ;; mark + ;; TODO: Implement a proced-toggle-mark? + "m" 'proced-mark ; Mentioned in documentation, should be followed. + "*" 'proced-mark-all + "M" '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 "") '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]order", 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/evil-collection-prodigy.el b/evil-collection-prodigy.el new file mode 100644 index 0000000..957d44c --- /dev/null +++ b/evil-collection-prodigy.el @@ -0,0 +1,76 @@ +;;; evil-collection-prodigy.el --- Evil bindings for prodigy -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `prodigy'. + +;;; Code: +(require 'evil) +(require 'prodigy nil t) + +(defun evil-collection-prodigy-setup () + "Set up `evil' bindings for `prodigy'." + (evil-define-key 'normal prodigy-mode-map + ;; quit + "q" 'quit-window + + "j" 'prodigy-next + "k" 'prodigy-prev + "gg" 'prodigy-first + "G" 'prodigy-last + + ;; TODO: Marking subject to change. + "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 "") '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-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/evil-collection-profiler.el b/evil-collection-profiler.el new file mode 100644 index 0000000..6bc66d8 --- /dev/null +++ b/evil-collection-profiler.el @@ -0,0 +1,69 @@ +;;; evil-collection-profiler.el --- Evil bindings for profiler -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `profiler'. + +;;; Code: +(require 'evil) +(require 'profiler) + +(defun evil-collection-profiler-setup () + "Set up `evil' bindings for `profiler'." + (evil-set-initial-state 'profiler-report-mode 'motion) + + (evil-define-key 'motion profiler-report-mode-map + ;; motion + (kbd "SPC") 'scroll-up-command + (kbd "S-SPC") 'scroll-down-command + (kbd "") 'scroll-down-command + "j" 'profiler-report-next-entry + "k" 'profiler-report-previous-entry + + (kbd "") 'profiler-report-toggle-entry + "i" '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 "") '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/evil-collection-rtags.el b/evil-collection-rtags.el new file mode 100644 index 0000000..ce5e6d4 --- /dev/null +++ b/evil-collection-rtags.el @@ -0,0 +1,136 @@ +;;; evil-collection-rtags.el --- Evil bindings for `rtags'. -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;;; Evil bindings for `rtags'. + +;;; Code: +(require 'evil) +(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) + +(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-define-key 'normal rtags-mode-map + ;; open + (kbd "") 'rtags-select + (kbd "S-") 'rtags-select-other-window + (kbd "M-") '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 ; TODO: Remove this binding? + + "c" 'rtags-select-caller + "C" 'rtags-select-caller-other-window + "x" 'rtags-select-and-remove-rtags-buffer + "q" 'rtags-call-bury-or-delete) + + (evil-define-key 'normal rtags-dependency-tree-mode-map + (kbd "TAB") 'rtags-dependency-tree-toggle-current-expanded + (kbd "E") 'rtags-dependency-tree-expand-all + (kbd "c") 'rtags-dependency-tree-collapse-all + (kbd "-") 'rtags-dependency-tree-collapse-current + (kbd "+") '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 "") 'rtags-select + (kbd "S-") 'rtags-select-other-window + (kbd "M-") '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) + + (evil-define-key 'normal rtags-references-tree-mode-map + (kbd "TAB") 'rtags-references-tree-toggle-current-expanded + + (kbd "E") 'rtags-references-tree-expand-all + (kbd "c") 'rtags-references-tree-collapse-all + (kbd "-") 'rtags-references-tree-collapse-current + (kbd "+") '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 "") 'rtags-select + (kbd "S-") 'rtags-select-other-window + (kbd "M-") '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) + + (evil-define-key 'normal rtags-location-stack-visualize-mode-map + ;; open + (kbd "") 'rtags-select + (kbd "S-") 'rtags-select-other-window + (kbd "M-") '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/evil-collection-slime.el b/evil-collection-slime.el new file mode 100644 index 0000000..7be2514 --- /dev/null +++ b/evil-collection-slime.el @@ -0,0 +1,105 @@ +;;; evil-collection-slime.el --- Evil bindings for `slime' -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `slime-mode'. + +;;; Code: +(require 'evil-collection-util) +(require 'slime nil t) + +(defvar sldb-mode-map) +(defvar slime-inspector-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))) + +(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-collection-util-evilify-map + sldb-mode-map + :mode sldb-mode + :bindings + "H" 'describe-mode + (kbd "C-j") 'sldb-down + (kbd "C-k") 'sldb-up + (kbd "M-j") 'sldb-details-down + (kbd "M-k") 'sldb-details-up + "gb" 'sldb-break-on-return + "gB" 'sldb-break-with-default-debugger) + + (evil-collection-util-evilify-map + slime-inspector-mode-map + :mode slime-inspector-mode + :bindings + ;; refresh + "gr" 'slime-inspector-reinspect) + + (evil-define-key 'normal slime-mode-map + (kbd "C-t") 'slime-pop-find-definition-stack + ;; goto + "gd" 'slime-edit-definition) + + (evil-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-set-initial-state 'slime-xref-mode 'normal) + (evil-define-key 'normal slime-xref-mode-map + (kbd "RET") 'slime-goto-xref + (kbd "S-") '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) + + (add-hook 'slime-popup-buffer-mode-hook #'evil-normalize-keymaps)) + +(provide 'evil-collection-slime) +;;; evil-collection-slime.el ends here diff --git a/evil-collection-term.el b/evil-collection-term.el new file mode 100644 index 0000000..45c78db --- /dev/null +++ b/evil-collection-term.el @@ -0,0 +1,127 @@ +;;; evil-collection-term.el --- Evil bindings for term and ansi-term -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; 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) +(require 'term) + +;;; 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"? + +(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-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-term-char-mode-entry-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")) + +(defun evil-collection-term-setup () + "Set up `evil' bindings for `term'." + (evil-set-initial-state 'term-mode 'insert) + (add-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-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 "") '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-define-key 'normal term-mode-map + (kbd "C-c C-k") 'evil-collection-term-char-mode-insert + (kbd "") '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)) + +(provide 'evil-collection-term) +;;; evil-collection-term.el ends here diff --git a/evil-collection-tide.el b/evil-collection-tide.el new file mode 100644 index 0000000..e91fdbd --- /dev/null +++ b/evil-collection-tide.el @@ -0,0 +1,61 @@ +;;; evil-collection-tide.el --- Bindings for `tide-mode'. -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;;; Bindings for `tide-mode'. + +;;; Code: +(require 'tide nil t) +(require 'evil) + +(defun evil-collection-tide-setup () + "Set up `evil' bindings for `tide'." + (evil-define-key 'normal tide-mode-map + "gd" 'tide-jump-to-definition + (kbd "C-t") 'tide-jump-back + "K" 'tide-documentation-at-point) + + (evil-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 "C-m") 'tide-goto-reference + (kbd "") 'tide-goto-reference + ;; quit + "q" 'quit-window) + + (evil-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 "C-m") 'tide-goto-error + (kbd "") 'tide-goto-error + ;; quit + (kbd "q") 'quit-window)) + +(provide 'evil-collection-tide) +;;; evil-collection-tide.el ends here diff --git a/evil-collection-transmission.el b/evil-collection-transmission.el new file mode 100644 index 0000000..9d2c095 --- /dev/null +++ b/evil-collection-transmission.el @@ -0,0 +1,144 @@ +;;; evil-collection-transmission.el --- Evil bindings for transmission.el -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + + +;;; Commentary: +;; Evil bindings for `transmission'. + +;;; Code: +(require 'evil) +(require 'transmission nil t) + +(defun evil-collection-transmission-setup () + "Set up `evil' bindings for `transmission'." + (evil-set-initial-state 'transmission-mode 'motion) + (evil-define-key 'motion transmission-mode-map + ;; motion + (kbd "SPC") 'scroll-up-command + (kbd "S-SPC") 'scroll-down-command + (kbd "") 'scroll-down-command + + ;; sort + "o" 'tabulated-list-sort + + (kbd "") 'transmission-files + "p" 'transmission-peers + "i" 'transmission-info + + "a" 'transmission-add + ;; "D" 'transmission-delete ; Useless with `transmission-remove'? + "p" '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 + "M" 'transmission-unmark-all + "~" 'transmission-invert-marks + + ;; refresh + "gr" 'revert-buffer + + ;; quit + "q" 'transmission-quit + "ZQ" 'evil-quit + "ZZ" 'transmission-quit) + + (evil-set-initial-state 'transmission-files-mode 'motion) + (evil-define-key 'motion transmission-files-mode-map + (kbd "SPC") 'scroll-up-command + (kbd "S-SPC") 'scroll-down-command + (kbd "") 'scroll-down-command + + ;; sort + "o" 'tabulated-list-sort + + "p" 'transmission-peers + "i" 'transmission-info + + "R" 'transmission-move + "u" 'transmission-files-unwant + "U" 'transmission-files-want + "P" 'transmission-files-priority + + ;; open + (kbd "") 'transmission-find-file + (kbd "S-") 'transmission-find-file-other-window + (kbd "M-") '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-set-initial-state 'transmission-info-mode 'motion) + (evil-define-key 'motion 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 + "gy" 'transmission-copy-magnet ; TODO: Use "ym"? + "R" 'transmission-move + + ;; quit + "q" 'quit-window + "ZQ" 'evil-quit + "ZZ" 'quit-window) + + (evil-set-initial-state 'transmission-peers-mode 'motion) + (evil-define-key 'motion 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/evil-collection-util.el b/evil-collection-util.el index 803b071..cfdefd1 100644 --- a/evil-collection-util.el +++ b/evil-collection-util.el @@ -35,7 +35,7 @@ "Set the default STATE for MODE." (let* ((mode-str (symbol-name mode)) (state-str (symbol-name state)) - (defun-name (intern (format "evil-integration-%s-set-%s-default" + (defun-name (intern (format "evil-collection-%s-set-%s-default" mode-str state-str)))) `(progn @@ -47,10 +47,10 @@ (advice-add #',mode :after #',defun-name)))) (defmacro evil-collection-util-evilify-map (map &rest props) - "`evil-evilified-state-evilify-map' with additional bindings. + "`evil-collection-evilified-state-evilify-map' with additional bindings. This assumes the :bindings key is at the end." (let ((contains-bindings (plist-get props :bindings))) - `(evil-evilified-state-evilify-map + `(evil-evilified-state-evilify ,map ,@props ,@(unless contains-bindings diff --git a/evil-collection-vlf.el b/evil-collection-vlf.el new file mode 100644 index 0000000..b6b908e --- /dev/null +++ b/evil-collection-vlf.el @@ -0,0 +1,75 @@ +;;; evil-collection-vlf.el --- Evil bindings for vlf -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `vlf'. + +;;; Code: +(require 'evil-collection-util) +(require 'vlf nil t) + +(defvar vlf-mode-map) + +(defun evil-collection-vlf-decrease-batch-size () + "Decrease vlf batch size by factor of 2." + (interactive) + (when (fboundp 'vlf-change-batch-size) + (vlf-change-batch-size t))) + +;;; Code: +(defun evil-collection-vlf-setup () + "Set up `evil' bindings for `vlf'." + (evil-set-initial-state 'vlf-mode 'normal) + + (evil-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 ; TODO: This binding clashes with "open". Change? + "L" 'vlf-goto-line + "F" 'vlf-toggle-follow)) + +(provide 'evil-collection-vlf) +;;; evil-collection-vlf.el ends here diff --git a/evil-collection-woman.el b/evil-collection-woman.el new file mode 100644 index 0000000..c5995df --- /dev/null +++ b/evil-collection-woman.el @@ -0,0 +1,47 @@ +;;; evil-collection-woman.el --- Evil bindings for WoMan -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `woman'. + +;;; Code: +(require 'evil) +(require 'evil-collection-man) ; WoMan's keymap inherits from Man. +(require 'woman) + +(defun evil-collection-woman-setup () + "Set up `evil' bindings for `woman'." + (evil-define-key 'motion 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/evil-collection-xref.el b/evil-collection-xref.el new file mode 100644 index 0000000..150c3fa --- /dev/null +++ b/evil-collection-xref.el @@ -0,0 +1,52 @@ +;;; evil-collection-xref.el --- Evil bindings for xref -*- lexical-binding: t -*- + +;; Copyright (C) 2017 James Nguyen + +;; Author: James Nguyen +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for `xref'. + +;;; Code: +(require 'evil-collection-util) +(require 'xref) + +(defun evil-collection-xref-setup () + "Set up `evil' bindings for `xref'." + (evil-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 + + ;; open + (kbd "") 'xref-goto-xref + (kbd "S-") 'xref-show-location-at-point + "o" 'xref-show-location-at-point ; TODO: Remove binding? + "go" 'xref-show-location-at-point)) + +(provide 'evil-collection-xref) +;;; evil-collection-xref.el ends here diff --git a/evil-collection-ztree.el b/evil-collection-ztree.el new file mode 100644 index 0000000..c6558b8 --- /dev/null +++ b/evil-collection-ztree.el @@ -0,0 +1,64 @@ +;;; evil-collection-ztree.el --- Evil bindings for ztree -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen , Pierre Neidhardt +;; URL: https://github.com/jojojames/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 . + +;;; Commentary: +;; Evil bindings for ztree. + +;;; Code: +(require 'evil) +(require 'ztree nil t) + +(defun evil-collection-ztree-setup () + "Set up `evil' bindings for `ztree'." + (evil-set-initial-state 'ztree-mode 'motion) + + (evil-define-key 'motion ztree-mode-map + (kbd "") 'ztree-jump-side + (kbd "") '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-define-minor-mode-key 'motion '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 diff --git a/evil-collection.el b/evil-collection.el index 4a8bed5..a053948 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -111,8 +111,8 @@ Alternatively, you may register select bindings manually, for instance: (with-eval-after-load 'calendar - (require 'evil-calendar) - (evil-calendar-setup))" + (require 'evil-collection-calendar) + (evil-collection-calendar-setup))" (interactive) (dolist (mode evil-collection-mode-list) (let ((m mode) @@ -122,8 +122,8 @@ instance: reqs (cdr mode))) (dolist (req reqs) (with-eval-after-load req - (require (intern (concat "evil-" (symbol-name m)))) - (funcall (intern (concat "evil-" (symbol-name m) "-setup")))))))) + (require (intern (concat "evil-collection-" (symbol-name m)))) + (funcall (intern (concat "evil-collection-" (symbol-name m) "-setup")))))))) (provide 'evil-collection) ;;; evil-collection.el ends here diff --git a/evil-comint.el b/evil-comint.el deleted file mode 100644 index 2883eb8..0000000 --- a/evil-comint.el +++ /dev/null @@ -1,52 +0,0 @@ -;;; evil-comint.el --- Bindings for `comint-mode'. -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;;; Bindings for `comint-mode'. - -;;; Code: -(require 'comint) -(require 'evil) - -(defun evil-comint-setup () - "Set up `evil' bindings for `comint'." - (when evil-want-C-d-scroll - (evil-define-key 'normal comint-mode-map - (kbd "C-d") #'evil-scroll-down)) - - (evil-define-key 'normal comint-mode-map - (kbd "C-j") #'comint-next-input - (kbd "C-k") #'comint-previous-input - (kbd "gj") #'comint-next-input - (kbd "gk") #'comint-previous-input - (kbd "]") #'comint-next-input - (kbd "[") #'comint-previous-input) - - (evil-define-key 'insert comint-mode-map - (kbd "") #'comint-previous-input - (kbd "") #'comint-next-input)) - -(provide 'evil-comint) -;;; evil-comint.el ends here diff --git a/evil-company.el b/evil-company.el deleted file mode 100644 index 068bc0c..0000000 --- a/evil-company.el +++ /dev/null @@ -1,76 +0,0 @@ -;;; evil-company.el --- Bindings for `company-mode'. -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;;; Bindings for `company-mode'. - -;;; Code: -(require 'company nil t) -(require 'evil) - -(defgroup evil-company nil - "Evil bindings for `company-mode'." - :group 'evil-collection) - -(defcustom evil-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-company - :type 'boolean) - -(defvar company-active-map) -(defvar company-search-map) - -(defun evil-company-setup () - "Set up `evil' bindings for `company'." - (define-key company-active-map (kbd "C-n") 'company-select-next-or-abort) - (define-key company-active-map (kbd "C-p") 'company-select-previous-or-abort) - (define-key company-active-map (kbd "C-j") 'company-select-next-or-abort) - (define-key company-active-map (kbd "C-k") 'company-select-previous-or-abort) - (define-key company-active-map (kbd "M-j") 'company-select-next) - (define-key company-active-map (kbd "M-k") 'company-select-previous) - - (when evil-want-C-u-scroll - (define-key company-active-map (kbd "C-u") 'company-previous-page)) - - (when evil-want-C-d-scroll - (define-key company-active-map (kbd "C-d") 'company-next-page)) - - (define-key company-search-map (kbd "C-j") 'company-select-next-or-abort) - (define-key company-search-map (kbd "C-k") 'company-select-previous-or-abort) - (define-key company-search-map (kbd "M-j") 'company-select-next) - (define-key company-search-map (kbd "M-k") 'company-select-previous) - - ;; Sets up YCMD like behavior. - (when evil-company-use-tng - (with-no-warnings (company-tng-configure-default)))) - -(provide 'evil-company) -;;; evil-company.el ends here diff --git a/evil-compile.el b/evil-compile.el deleted file mode 100644 index 2251e84..0000000 --- a/evil-compile.el +++ /dev/null @@ -1,58 +0,0 @@ -;;; evil-compile.el --- Evil bindings for `compile' -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `compile'. - -;;; Code: -(require 'evil-collection-util) -(require 'compile) - -(defun evil-compile-setup () - "Set up `evil' bindings for `compile'." - (evil-set-initial-state 'compilation-mode 'normal) - - (evil-define-key 'normal compilation-mode-map - "g?" 'describe-mode - "?" '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 "") 'compile-goto-error - - "go" 'compilation-display-error - (kbd "S-") '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-compile) -;;; evil-compile.el ends here diff --git a/evil-cus-theme.el b/evil-cus-theme.el deleted file mode 100644 index 5c9d2f1..0000000 --- a/evil-cus-theme.el +++ /dev/null @@ -1,61 +0,0 @@ -;;; evil-cus-theme.el --- Bindings for `cus-theme'. -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;;; Bindings for `cus-theme'. - -;;; Code: -(require 'cus-theme) -(require 'evil) - -(defun evil-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-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-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-cus-theme) -;;; evil-cus-theme.el ends here diff --git a/evil-custom.el b/evil-custom.el deleted file mode 100644 index 55111b4..0000000 --- a/evil-custom.el +++ /dev/null @@ -1,65 +0,0 @@ -;;; evil-custom.el --- Evil bindings for Customize -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for the Customize interface. - -;;; Code: -(require 'cus-edit) -(require 'evil) - -(defun evil-custom-setup () - "Set up `evil' bindings for `Custom-mode'." - (evil-set-initial-state 'Custom-mode 'normal) - - (evil-define-key 'normal custom-mode-map - ;; motion - (kbd "") 'widget-forward - (kbd "S-") 'widget-backward - (kbd "") 'widget-backward - (kbd "SPC") 'scroll-up-command - (kbd "S-SPC") 'scroll-down-command - (kbd "") 'scroll-down-command - (kbd "") '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-custom) -;;; evil-custom.el ends here diff --git a/evil-debbugs.el b/evil-debbugs.el deleted file mode 100644 index 4a196c1..0000000 --- a/evil-debbugs.el +++ /dev/null @@ -1,73 +0,0 @@ -;;; evil-debbugs.el --- Evil bindings for debbugs -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for debbugs. - -;;; Code: -(require 'debbugs nil t) -(require 'evil) - -(defun evil-debbugs-mode-setup () - "Set up `evil' bindings for `debbugs-gnu-mode'." - (evil-set-initial-state 'debbugs-gnu-mode 'motion) - - (evil-define-key 'motion debbugs-gnu-mode-map - ;; motion - (kbd "") 'forward-button - (kbd "") 'backward-button - (kbd "SPC") 'scroll-up-command - - (kbd "") 'debbugs-gnu-select-report - "c" 'debbugs-gnu-send-control-message - "d" 'debbugs-gnu-display-status - - ;; filter - (kbd "s") 'debbugs-gnu-narrow-to-status - ;; "S" 'debbugs-gnu-widen ; Useless if we can just press "s RET" (empty filter). - "S" '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 - - ;; quit - "q" 'quit-window - "ZQ" 'quit-window - "ZZ" 'quit-window)) - -(provide 'evil-debbugs) -;;; evil-debbugs.el ends here diff --git a/evil-debug.el b/evil-debug.el deleted file mode 100644 index 7388b3d..0000000 --- a/evil-debug.el +++ /dev/null @@ -1,63 +0,0 @@ -;;; evil-debug.el --- Evil bindings for the debugger -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for the debugger. - -;;; Code: - -(require 'evil) -(require 'debug) - -(defun evil-debug-setup () - "Set up `evil' bindings for `debug'." - (evil-set-initial-state 'debugger-mode 'motion) - - (evil-define-key 'motion debugger-mode-map - ;; motion - (kbd "") 'forward-button - (kbd "S-") 'backward-button - (kbd "") 'debug-help-follow - (kbd "SPC") 'next-line - - "R" 'debugger-record-expression - "c" 'debugger-continue - "d" 'debugger-step-through - "x" 'debugger-eval-expression - "J" 'debugger-jump - - "gl" 'debugger-list-functions - "gb" 'debugger-frame - "r" 'debugger-return-value - "u" 'debugger-frame-clear - "p" 'debugger-toggle-locals - - ;; quit - "q" 'top-level - "ZQ" 'evil-quit - "ZZ" 'top-level)) - -(provide 'evil-debug) -;;; evil-debug.el ends here diff --git a/evil-diff-mode.el b/evil-diff-mode.el deleted file mode 100644 index c4b26d7..0000000 --- a/evil-diff-mode.el +++ /dev/null @@ -1,142 +0,0 @@ -;;; evil-diff-mode.el --- Add Evil bindings to diff-mode -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; -;; Evil-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-diff-toggle-setup'. - -;;; Code: - -(require 'evil) -(require 'diff-mode) - -(defun evil-diff-read-only-state-switch () - "Make read-only in motion state, writable in normal state." - (if buffer-read-only - (progn - (evil-motion-state) - (message "Evil Diff: enter motion state")) - (evil-normal-state) - (message "Evil Diff: enter normal state"))) - -(defun evil-diff-toggle-setup () - "Toggle visiting diff buffers in motion state." - (interactive) - (when (eq major-mode 'diff-mode) - (if (memq 'evil-diff-read-only-state-switch read-only-mode-hook) - (remove-hook 'read-only-mode-hook 'evil-diff-read-only-state-switch t) - (add-hook 'read-only-mode-hook 'evil-diff-read-only-state-switch nil t) - (read-only-mode)))) - -;;; TODO: Report toggle function upstream? -(defun evil-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-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))) - -(defun evil-diff-mode-setup () - "Set up `evil' bindings for `diff-mode'." - - (evil-set-initial-state 'diff-mode 'motion) - - (evil-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 - - "\\" 'read-only-mode) ; magit has "\" - - (evil-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 "") '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-diff-toggle-restrict-view - "~" 'diff-reverse-direction - "s" 'diff-split-hunk - "c" 'diff-test-hunk - "x" 'evil-diff-toggle-context-unified - "#" 'diff-ignore-whitespace-hunk - - "\\" 'read-only-mode)) ; magit has "\" - - - -(add-hook 'diff-mode-hook 'evil-diff-toggle-setup) - -(defun evil-diff-unload-function () - "For `unload-feature'." - (remove-hook 'diff-mode-hook 'evil-diff-toggle-setup)) - -(provide 'evil-diff-mode) -;;; evil-diff-mode.el ends here diff --git a/evil-dired.el b/evil-dired.el deleted file mode 100644 index c7f6b0e..0000000 --- a/evil-dired.el +++ /dev/null @@ -1,192 +0,0 @@ -;;; evil-dired.el --- Evil bindings for Dired -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for Dired. - -;;; Code: -(require 'dired) -(require 'evil-collection-util) - -(defun evil-dired-setup () - "Set up `evil' bindings for `dired'." - (evil-define-key 'normal dired-mode-map - "g" nil - "q" 'quit-window - "j" 'dired-next-line - "k" 'dired-previous-line - "l" 'evil-forward-char - "h" 'evil-backward-char - ":" 'evil-ex - "w" 'evil-forward-word-begin - "e" 'evil-forward-word-end - "y" 'evil-yank - "f" 'evil-find-char - "v" 'evil-visual-char - "G" 'evil-goto-line - "$" 'evil-end-of-line - "n" 'evil-search-next - [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 - "*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 "* ") '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-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 "") 'dired-find-file - (kbd "S-") 'dired-find-file-other-window - (kbd "M-") 'dired-display-file - "go" 'dired-find-file-other-window - "gO" 'dired-view-file - ;; sort - "o" 'dired-sort-toggle-or-edit - ;; moving - "<" 'dired-prev-dirline - ">" 'dired-next-dirline - "^" '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 "") '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-dired) -;;; evil-dired.el ends here diff --git a/evil-doc-view.el b/evil-doc-view.el deleted file mode 100644 index 3397276..0000000 --- a/evil-doc-view.el +++ /dev/null @@ -1,80 +0,0 @@ -;;; evil-doc-view.el --- Evil bindings for docview. -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;;; Evil bindings for doc-view. - -;;; Code: -(require 'evil) -(require 'doc-view) - -(defun evil-doc-view-setup () - "Set up `evil' bindings for `doc-view'." - (evil-set-initial-state 'doc-view-mode 'motion) - (evil-define-key 'motion doc-view-mode-map - (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 "") '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-define-key 'motion doc-view-mode-map - (kbd "C-u") 'backward-page))) - -(provide 'evil-doc-view) -;;; evil-doc-view.el ends here diff --git a/evil-edebug.el b/evil-edebug.el deleted file mode 100644 index ba62daa..0000000 --- a/evil-edebug.el +++ /dev/null @@ -1,111 +0,0 @@ -;;; evil-edebug.el --- Evil bindings for Edebug -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `edebug-mode'. - -;;; Code: -(require 'edebug) -(require 'evil-collection-util) - -(evil-collection-util-set-initial-state edebug-mode motion) - -(defun evil-edebug-setup () - "Set up `evil' bindings for `edebug'." - (evil-define-key 'motion edebug-mode-map - ;; control - " " nil - "s" 'edebug-step-mode - "n" 'edebug-next-mode - "go" 'edebug-go-mode - "gn" '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 - "EE" '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-define-key 'motion edebug-x-instrumented-function-list-mode-map - "E" 'edebug-x-evaluate-function - "Q" 'edebug-x-clear-data - (kbd "") 'edebug-x-find-function - "q" 'quit-window) - (evil-define-key 'motion edebug-x-breakpoint-list-mode-map - (kbd "") 'edebug-x-visit-breakpoint - "x" 'edebug-x-kill-breakpoint - "Q" 'edebug-x-clear-data - "q" 'quit-window))) - -(provide 'evil-edebug) -;;; evil-edebug.el ends here diff --git a/evil-elfeed.el b/evil-elfeed.el deleted file mode 100644 index 2123ccb..0000000 --- a/evil-elfeed.el +++ /dev/null @@ -1,97 +0,0 @@ -;;; evil-elfeed.el --- Evil bindings for elfeed -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for elfeed. - -;;; Code: -(require 'elfeed nil t) -(require 'evil) - -(defun evil-elfeed-setup () - "Set up `evil' bindings for `elfeed'." - (evil-set-initial-state 'elfeed-search-mode 'motion) - - (evil-define-key 'motion elfeed-search-mode-map - ;; open - (kbd "") 'elfeed-search-show-entry - (kbd "S-") 'elfeed-search-browse-url - "go" 'elfeed-search-browse-url - - "y" 'elfeed-search-yank - - ;; 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-define-key '(motion 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-set-initial-state 'elfeed-show-mode 'motion) - (evil-define-key 'motion elfeed-show-mode-map - (kbd "S-") 'elfeed-show-visit - "go" 'elfeed-show-visit - - ;; filter - "s" 'elfeed-show-new-live-search - - "y" 'elfeed-show-yank - - "+" '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)) - -(provide 'evil-elfeed) -;;; evil-elfeed.el ends here diff --git a/evil-elisp-mode.el b/evil-elisp-mode.el deleted file mode 100644 index b788633..0000000 --- a/evil-elisp-mode.el +++ /dev/null @@ -1,77 +0,0 @@ -;;; evil-elisp-mode.el --- Bindings for `elisp-mode'. -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;;; Bindings for `elisp-mode'. - -;;; Code: -(require 'elisp-mode) -(require 'evil) - -(defun evil-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-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-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-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))) - -(defun evil-elisp-mode-setup () - "Set up `evil' bindings for `elisp-mode'." - (unless evil-move-beyond-eol - (advice-add 'eval-print-last-sexp :around 'evil-elisp-mode-last-sexp)) - (advice-add 'last-sexp-setup-props - :override 'evil-elisp-mode-last-sexp-setup-props)) - -(provide 'evil-elisp-mode) -;;; evil-elisp-mode.el ends here diff --git a/evil-elisp-refs.el b/evil-elisp-refs.el deleted file mode 100644 index fc2cc35..0000000 --- a/evil-elisp-refs.el +++ /dev/null @@ -1,49 +0,0 @@ -;;; evil-elisp-refs.el --- Evil bindings for Elisp Refs -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; This package provides a sane set of defaults for `elisp-refs' when using -;; `evil-mode'. - -;;; Code: -(require 'evil-collection-util) -(require 'elisp-refs nil t) - -(defun evil-elisp-refs-setup () - "Set up `evil' bindings for `elisp-refs'." - (evil-define-key 'normal elisp-refs-mode-map - (kbd "") 'elisp-refs-next-match - (kbd "") '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 "") 'elisp-refs-visit-match - - ;; quit - "q" 'kill-this-buffer)) - -(provide 'evil-elisp-refs) -;;; evil-elisp-refs.el ends here diff --git a/evil-emms.el b/evil-emms.el deleted file mode 100644 index f2c3233..0000000 --- a/evil-emms.el +++ /dev/null @@ -1,193 +0,0 @@ -;;; evil-emms.el --- Evil bindings for EMMS -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for EMMS. - -;;; Code: -(require 'emms nil t) -(require 'evil) - -(defvar emms-browser-mode-map) -(defvar emms-playlist-mode-map) - -;;; TODO: Make all playback bindings consistent across modes: -;;; - stop -;;; - pause -;;; - volume -;;; - next/previous -;;; - fast-forward/backward - -;;; TODO: Add bindings to emms-browser-search-mode-map. - -;;; emms-browser does not run any mode hook. As such the default state is 'normal. -;;; TODO: Report upstream. -(defun evil-emms-browser () - "Default `emms-browser' to motion state." - (evil-motion-state)) - -(with-no-warnings - (defun evil-emms-playlist-mode-insert-newline-above () - "Insert a newline above point." - (interactive) - (emms-with-inhibit-read-only-t - (evil-insert-newline-above))) - - (defun evil-emms-playlist-mode-insert-newline-below () - "Insert a newline below point." - (interactive) - (emms-with-inhibit-read-only-t - (evil-insert-newline-below))) - - (defun evil-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-emms-playlist-mode-paste-after () - "Pastes the latest yanked playlist items behind point. - The return value is the yanked text." - (interactive) - (evil-next-line) - (evil-emms-playlist-mode-paste-before))) - -(defun evil-emms-setup () - "Set up `evil' bindings for `emms'." - (advice-add 'emms-browser :after 'evil-emms-browser) - (evil-set-initial-state 'emms-playlist-mode 'motion) - - (with-eval-after-load 'emms-browser - (dolist (map (list emms-browser-mode-map emms-playlist-mode-map)) - (evil-define-key* 'motion map - "+" 'emms-volume-raise - "=" 'emms-volume-raise - "-" 'emms-volume-lower - "u" 'emms-playlist-mode-undo)) - - ;; TODO: Why do we need to define emms-browser-mode-map after load and not emms-playlist-mode-map? - (evil-define-key 'motion emms-browser-mode-map - ;; playback controls - "x" 'emms-pause - "X" 'emms-stop - "r" 'emms-random - "<" 'emms-seek-backward - ">" 'emms-seek-forward - (kbd "") 'emms-browser-add-tracks - (kbd "C-") 'emms-browser-add-tracks-and-play - - ;; motion - "[" 'emms-browser-prev-non-track - "]" 'emms-browser-next-non-track - "gj" 'emms-browser-prev-non-track - "gk" 'emms-browser-next-non-track - - (kbd "") 'emms-browser-toggle-subitems - (kbd "SPC") 'emms-browser-toggle-subitems - ;; TODO: Use S-? - "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 - - "/" 'emms-isearch-buffer ; This shows hidden items during search. - - ;; filter - ;; "" 'emms-browser-previous-filter ; TODO: What does this do? - ;; "" 'emms-browser-next-filter - - "s" (lookup-key emms-browser-mode-map (kbd "s")) - "g" (lookup-key emms-browser-mode-map (kbd "W")) ;; TODO: This overrides other "g-" prefixed keys. - - "C" 'emms-browser-clear-playlist - "D" 'emms-browser-delete-files - "d" 'emms-browser-view-in-dired - "gd" 'emms-playlist-mode-goto-dired-at-point)) ; "d" does the same, keep "gd" for consistency. - - (evil-define-key 'motion 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 "") 'emms-playlist-mode-play-smart - - ;; motion - "gg" 'emms-playlist-mode-first - "G" 'emms-playlist-mode-last - "]" 'emms-playlist-mode-next - "[" 'emms-playlist-mode-previous - "gj" 'emms-playlist-mode-next - "gk" 'emms-playlist-mode-previous - - "D" 'emms-playlist-mode-kill-track ; emms-browser uses "D" - "C" 'emms-playlist-mode-clear - "O" 'evil-emms-playlist-mode-insert-newline-above - "o" 'evil-emms-playlist-mode-insert-newline-below - "P" 'evil-emms-playlist-mode-paste-before - "p" 'evil-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 - "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-define-key 'visual emms-playlist-mode-map - ;; "d" 'emms-playlist-mode-kill - "D" 'emms-playlist-mode-kill)) - -(provide 'evil-emms) -;;; evil-emms.el ends here diff --git a/evil-eshell.el b/evil-eshell.el deleted file mode 100644 index 8be1226..0000000 --- a/evil-eshell.el +++ /dev/null @@ -1,94 +0,0 @@ -;;; evil-eshell.el --- Evil bindings for Eshell -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for EMMS - -;;; Code: -(require 'em-prompt) -(require 'eshell) -(require 'evil) - -(defun evil-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-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-eshell-next-prompt nil t))) - -(defun evil-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-eshell-setup-keys () - "Set up `evil' bindings for `eshell'." - (evil-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 "") 'eshell-send-input - (kbd "C-c C-c") 'evil-eshell-interrupt-process) - (evil-define-key 'insert eshell-mode-map - ;; motion - (kbd "M-h") 'eshell-backward-argument - (kbd "M-l") 'eshell-forward-argument) - (evil-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. -(defun evil-eshell-setup () - "Set up `evil' bindings for `eshell'." - (add-hook 'eshell-mode-hook 'evil-eshell-next-prompt-on-insert) - (add-hook 'eshell-first-time-mode-hook 'evil-eshell-setup-keys)) - -(provide 'evil-eshell) -;;; evil-eshell.el ends here diff --git a/evil-eval-sexp-fu.el b/evil-eval-sexp-fu.el deleted file mode 100644 index dd370f8..0000000 --- a/evil-eval-sexp-fu.el +++ /dev/null @@ -1,59 +0,0 @@ -;;; evil-eval-sexp-fu.el --- Bindings for `eval-sexp-fu'. -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;;; Bindings for `eval-sexp-fu'. - -;;; Code: -(require 'evil) -(with-no-warnings - (require 'eval-sexp-fu nil t)) - -(defun evil-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-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-eval-sexp-fu-bounds-of-thing-at-point-sexp) - (apply command args) - (advice-remove 'bounds-of-thing-at-point - 'evil-eval-sexp-fu-bounds-of-thing-at-point-sexp)) - -(defun evil-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-eval-sexp-fu-advise-bounds-of-thing-at-point))) - -(provide 'evil-eval-sexp-fu) -;;; evil-eval-sexp-fu.el ends here diff --git a/evil-flycheck.el b/evil-flycheck.el deleted file mode 100644 index aafd302..0000000 --- a/evil-flycheck.el +++ /dev/null @@ -1,53 +0,0 @@ -;;; evil-flycheck.el --- Evil bindings for flycheck -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `flycheck-mode'. - -;;; Code: -(require 'evil-collection-util) -(require 'flycheck nil t) - -(defvar flycheck-error-list-mode-map) - -(defun evil-flycheck-setup () - "Set up `evil' bindings for `flycheck'." - (evil-set-initial-state 'flycheck-error-list-mode 'normal) - (evil-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 "") 'flycheck-error-list-goto-error - "q" 'quit-window)) - -(provide 'evil-flycheck) -;;; evil-flycheck.el ends here diff --git a/evil-geiser.el b/evil-geiser.el deleted file mode 100644 index 3250907..0000000 --- a/evil-geiser.el +++ /dev/null @@ -1,90 +0,0 @@ -;;; evil-geiser.el --- Bindings for `geiser'. -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;;; Bindings for `geiser'. - -;;; Code: -(require 'evil) -(require 'geiser nil t) - -(defvar geiser-debug-mode-map) -(defvar geiser-doc-mode-map) - -(defun evil-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))) - -(defun evil-geiser-setup () - "Set up bindings for `geiser'." - (unless evil-move-beyond-eol - (advice-add 'geiser-eval-last-sexp :around 'evil-geiser-last-sexp) - (advice-add 'geiser-eval-last-sexp-and-print :around 'evil-geiser-last-sexp)) - - (evil-set-initial-state 'geiser-debug-mode 'normal) - (evil-set-initial-state 'geiser-doc-mode 'normal) - - (evil-define-key 'normal geiser-debug-mode-map - "q" 'quit-window) - - (evil-define-key 'normal geiser-doc-mode-map - "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-define-key 'insert geiser-repl-mode-map - (kbd "S-") 'geiser-repl--newline-and-indent) - - (evil-define-key 'normal geiser-repl-mode-map - "gd" 'geiser-edit-symbol-at-point - (kbd "C-t") 'geiser-pop-symbol-stack - (kbd "K") 'geiser-doc-symbol-at-point) - - (evil-define-key 'normal geiser-mode-map - "gd" 'geiser-edit-symbol-at-point - (kbd "C-t") 'geiser-pop-symbol-stack - (kbd "gZ") 'geiser-mode-switch-to-repl-and-enter - (kbd "gz") 'geiser-mode-switch-to-repl - (kbd "K") 'geiser-doc-symbol-at-point)) - -(provide 'evil-geiser) -;;; evil-geiser.el ends here diff --git a/evil-ggtags.el b/evil-ggtags.el deleted file mode 100644 index 330ae5b..0000000 --- a/evil-ggtags.el +++ /dev/null @@ -1,94 +0,0 @@ -;;; evil-ggtags.el --- Evil bindings for ggtags -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `ggtags-mode'. - -;;; Code: -(require 'evil-collection-util) -(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) - -(defun evil-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-define-key 'normal ggtags-mode-map - "gd" 'ggtags-find-tag-dwim - (kbd "C-t") 'ggtags-prev-mark - "gf" 'ggtags-find-file) - - (evil-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-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-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 "") 'ggtags-navigation-mode-done)) - -(provide 'evil-ggtags) -;;; evil-ggtags.el ends here diff --git a/evil-helm.el b/evil-helm.el deleted file mode 100644 index cb3679e..0000000 --- a/evil-helm.el +++ /dev/null @@ -1,81 +0,0 @@ -;;; evil-helm.el --- Evil bindings for Helm -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for Helm. - -;;; Code: -(require 'evil) -(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 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-read-file-map) - -(defun evil-helm-setup () - "Set up `evil' bindings for `helm'." - (evil-define-key '(insert normal) helm-map - (kbd "M-[") 'helm-previous-source - (kbd "M-]") 'helm-next-source - (kbd "M-l") 'helm-execute-persistent-action) - (dolist (map (list helm-find-files-map helm-read-file-map)) - ;; TODO: We should use evil-define-key but it does not seem to work. - (define-key map (kbd "M-h") 'helm-find-files-up-one-level) - (define-key map (kbd "C-l") nil)) ; So the Helm header displays the "M-l" binding. - - (evil-define-key 'normal helm-map - (kbd "[") 'helm-previous-source - (kbd "]") '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 - - ;; refresh - "gr" 'helm-refresh - - "p" 'helm-yank-selection - "P" 'helm-copy-to-buffer - "y" 'helm-kill-selection-and-quit - (kbd "SPC") 'helm-toggle-visible-mark) - - (evil-define-key '(normal insert) helm-map - (kbd "M-j") 'helm-next-line - (kbd "M-k") 'helm-previous-line - (kbd "C-f") 'helm-next-page - (kbd "C-b") 'helm-previous-page)) - -(provide 'evil-helm) -;;; evil-helm.el ends here diff --git a/evil-help.el b/evil-help.el deleted file mode 100644 index 816d0d9..0000000 --- a/evil-help.el +++ /dev/null @@ -1,66 +0,0 @@ -;;; evil-help.el --- Evil bindings for help-mode -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `help-mode'. - -;;; Code: -(require 'evil) -(require 'help-mode) - -(defun evil-help-setup () - "Set up `evil' bindings for `help'." - (evil-set-initial-state 'help-mode 'normal) - (evil-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 "") 'forward-button - (kbd "") '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 - - "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-help) -;;; evil-help.el ends here diff --git a/evil-ibuffer.el b/evil-ibuffer.el deleted file mode 100644 index 2670025..0000000 --- a/evil-ibuffer.el +++ /dev/null @@ -1,54 +0,0 @@ -;;; evil-ibuffer.el --- Evil bindings for IBuffer -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for IBuffer. - -;;; Code: -(require 'evil-collection-util) -(require 'ibuffer) - -(defun evil-ibuffer-setup () - "Set up `evil' bindings for `ibuffer'." - (evil-collection-util-evilify-map - ibuffer-mode-map - :mode ibuffer-mode - :bindings - "gb" 'ibuffer-bury-buffer - "gB" 'ibuffer-copy-buffername-as-kill - "gw" 'ibuffer-copy-filename-as-kill - "gW" 'ibuffer-do-view-and-eval - - ;; refresh - "gr" 'ibuffer-update - - "gx" 'ibuffer-kill-line - (kbd "C-j") 'ibuffer-forward-filter-group - (kbd "C-k") 'ibuffer-backward-filter-group ; Originally `ibuffer-kill-line'. - "gj" 'ibuffer-forward-filter-group - "gk" 'ibuffer-backward-filter-group)) - -(provide 'evil-ibuffer) -;;; evil-ibuffer.el ends here diff --git a/evil-image+.el b/evil-image+.el deleted file mode 100644 index 6e31674..0000000 --- a/evil-image+.el +++ /dev/null @@ -1,49 +0,0 @@ -;;; evil-image+.el --- Evil bindings for image-mode with image+ -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for image-mode with image+. - -;;; Code: -(require 'evil) -(require 'image+ nil t) - -(defun evil-image+-setup () - "Set up `evil' bindings for `image+'." - (evil-define-key 'motion 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 - "l" 'imagex-sticky-rotate-left)) - -(provide 'evil-image+) -;;; evil-image+.el ends here diff --git a/evil-image.el b/evil-image.el deleted file mode 100644 index 63fe93d..0000000 --- a/evil-image.el +++ /dev/null @@ -1,90 +0,0 @@ -;;; evil-image.el --- Evil bindings for Image -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `image-mode'. - -;;; Code: -(require 'evil) -(require 'image-mode) - -;; TODO: pdf and doc-view conflict with image. -;; See https://github.com/jojojames/evil-collection/issues/23. - -(defun evil-image-setup () - "Set up `evil' bindings for `image-mode'." - (evil-set-initial-state 'image-mode 'motion) - - (evil-define-key 'motion 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-down - (kbd "SPC") 'image-scroll-up - (kbd "S-SPC") 'image-scroll-down - (kbd "") 'image-scroll-down - - ;; animation - (kbd "") '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-define-key 'motion image-mode-map - (kbd "C-u") 'image-scroll-up))) - -(provide 'evil-image) -;;; evil-image.el ends here diff --git a/evil-info.el b/evil-info.el deleted file mode 100644 index 1ce6716..0000000 --- a/evil-info.el +++ /dev/null @@ -1,77 +0,0 @@ -;;; evil-info.el --- Evil bindings for Info-mode -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; The default bindings in motion state override the standard -;; movement keys. This package restores them. - -;;; Code: -(require 'evil) -(require 'info) - -(defun evil-info-setup () - "Set up `evil' bindings for `info-mode'." - (evil-define-key 'motion Info-mode-map - ;; motion: Restore some Evil keys that got overriden. - "w" 'evil-forward-word-begin - "e" 'evil-forward-word-end - "ge" 'evil-backward-word-end - "gE" 'evil-backward-WORD-end - "b" 'evil-backward-word-begin - "gg" 'evil-goto-first-line - "t" 'evil-find-char-to - "T" 'evil-find-char-to-backward - "f" 'evil-find-char - "n" 'evil-search-next - "?" 'evil-search-backward - (kbd "") 'Info-next-reference - (kbd "S-") 'Info-prev-reference - - ;; TODO: Should search with "n"/"N" cover the full manual like "C-s"/"C-r" does? - - ;; goto - "gd" 'Info-goto-node ; TODO: "gd" does not match the rationale of "go to definition". Change? - "gt" 'Info-top-node - "gT" 'Info-toc - "gf" 'Info-follow-reference - (kbd "C-o") 'Info-history-back - (kbd "C-i") 'Info-history-forward - ;; 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 - - (kbd "M-w") 'Info-copy-current-node-name ; TODO: Use yn? - "p" nil - - ;; quit - "q" 'Info-exit - "ZQ" 'evil-quit - "ZZ" 'Info-exit)) - -(provide 'evil-info) -;;; evil-info.el ends here diff --git a/evil-ivy.el b/evil-ivy.el deleted file mode 100644 index a58eedd..0000000 --- a/evil-ivy.el +++ /dev/null @@ -1,79 +0,0 @@ -;;; evil-ivy.el --- Evil bindings for ivy -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `ivy-mode'. - -;;; Code: -(require 'evil) -(require 'ivy nil t) - -(defun evil-ivy-setup () - "Set up `evil' bindings for `ivy-mode'." - (evil-define-key 'normal ivy-occur-mode-map - [mouse-1] 'ivy-occur-click - (kbd "") 'ivy-occur-press-and-switch - (kbd "j") 'ivy-occur-next-line - (kbd "k") 'ivy-occur-previous-line - (kbd "h") 'evil-backward-char - (kbd "l") 'evil-forward-char - (kbd "g") nil - (kbd "gg") 'evil-goto-first-line - (kbd "gf") 'ivy-occur-press - (kbd "gr") 'ivy-occur-revert-buffer - (kbd "ga") 'ivy-occur-read-action - (kbd "go") 'ivy-occur-dispatch - (kbd "gc") 'ivy-occur-toggle-calling - - ;; quit - (kbd "q") 'quit-window) - - (when evil-want-C-d-scroll - (evil-define-key 'normal ivy-occur-grep-mode-map - "D" 'ivy-occur-delete-candidate - (kbd "C-d") 'evil-scroll-down)) - - (evil-define-key 'normal ivy-occur-grep-mode-map - (kbd "C-x C-q") 'ivy-wgrep-change-to-wgrep-mode - "gd" 'ivy-occur-delete-candidate - [mouse-1] 'ivy-occur-click - (kbd "") '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 - - ;; quit - (kbd "q") 'quit-window)) - -(provide 'evil-ivy) -;;; evil-ivy.el ends here diff --git a/evil-macrostep.el b/evil-macrostep.el deleted file mode 100644 index a2b188f..0000000 --- a/evil-macrostep.el +++ /dev/null @@ -1,49 +0,0 @@ -;;; evil-macrostep.el --- Evil Integration for Macrostep -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `macrostep-mode'. - -;;; Code: -(require 'evil-collection-util) -(require 'macrostep nil t) - -(defun evil-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-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-macrostep) -;;; evil-macrostep.el ends here diff --git a/evil-man.el b/evil-man.el deleted file mode 100644 index d235a20..0000000 --- a/evil-man.el +++ /dev/null @@ -1,64 +0,0 @@ -;;; evil-man.el --- Evil bindings for Man-mode -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `man'. - -;;; Code: -(require 'evil) -(require 'man) - -(defun evil-man-setup () - "Set up `evil' bindings for `man'." - (evil-define-key 'motion Man-mode-map - ;; motion - (kbd "SPC") 'scroll-up-command - (kbd "S-SPC") 'scroll-down-command - (kbd "") 'forward-button - (kbd "") '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" 'Man-quit - "ZQ" 'evil-quit - "ZZ" 'Man-quit)) - -(provide 'evil-man) -;;; evil-man.el ends here diff --git a/evil-minibuffer.el b/evil-minibuffer.el deleted file mode 100644 index 858a426..0000000 --- a/evil-minibuffer.el +++ /dev/null @@ -1,70 +0,0 @@ -;;; evil-minibuffer.el --- Evil bindings for the minibuffer -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for the minibuffer. - -;;; Code: -(require 'evil) - -(defun evil-minibuffer-insert () - "Switch to insert state. - -This function is meant to be hooked in the minibuffer: - - (add-hook 'minibuffer-setup-hook 'evil-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)) - -(defun evil-minibuffer-init () - "Initialize minibuffer for `evil'." - ;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-from-Minibuffer.html - ;; WARNING: With lexical binding, lambdas from `mapc' and `dolist' become - ;; closures in which we must use `evil-define-key*' instead of - ;; `evil-define-key'. - (dolist (map (list minibuffer-local-map - minibuffer-local-ns-map - minibuffer-local-completion-map - minibuffer-local-must-match-map - minibuffer-local-isearch-map)) - (evil-define-key* 'normal map (kbd "") 'abort-recursive-edit) - (evil-define-key* 'normal map (kbd "") 'exit-minibuffer)) - (add-hook 'minibuffer-setup-hook 'evil-minibuffer-insert) - ;; Because of the above minibuffer-setup-hook, some evil-ex bindings need be reset. - (evil-define-key 'normal evil-ex-completion-map (kbd "") 'abort-recursive-edit) - (evil-define-key 'insert evil-ex-completion-map (kbd "C-p") 'previous-complete-history-element) - (evil-define-key 'insert evil-ex-completion-map (kbd "C-n") 'next-complete-history-element) - (evil-define-key 'normal evil-ex-completion-map (kbd "C-p") 'previous-history-element) - (evil-define-key 'normal evil-ex-completion-map (kbd "C-n") 'next-history-element)) - -(provide 'evil-minibuffer) -;;; evil-minibuffer.el ends here diff --git a/evil-occur.el b/evil-occur.el deleted file mode 100644 index a3d7546..0000000 --- a/evil-occur.el +++ /dev/null @@ -1,70 +0,0 @@ -;;; evil-occur.el --- Evil bindings for occur -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `occur'. - -;;; Code: -(require 'evil-collection-util) - -(when (> emacs-major-version 25) - (require 'replace)) - -(defun evil-occur-setup () - "Set up `evil' bindings for `occur'." - (evil-set-initial-state 'occur-mode 'normal) - - (evil-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 "") 'occur-mode-goto-occurrence - (kbd "S-") 'occur-mode-goto-occurrence-other-window - (kbd "M-") '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-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-occur) -;;; evil-occur.el ends here diff --git a/evil-outline.el b/evil-outline.el deleted file mode 100644 index 33385c1..0000000 --- a/evil-outline.el +++ /dev/null @@ -1,82 +0,0 @@ -;;; evil-outline.el --- Evil bindings for outline-mode -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for outline-mode. - -;;; Code: -(require 'evil) -(require 'outline) - -(defun evil-outline-setup () - "Set up `evil' bindings for `outline'." - (evil-define-key 'motion 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. - (kbd "S-") 'outline-show-all ; Also "z r" by default - (kbd "") 'outline-toggle-children ; Also "z a" by default - ;; "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". - - "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 - "^" 'outline-up-heading - - (kbd "M-h") 'outline-move-demote ; Org-mode has "M-", Evil-org has "M-h" - (kbd "M-j") 'outline-move-subtree-down ; Org-mode has "M-", Evil-org has "M-j" - (kbd "M-k") 'outline-move-subtree-up ; Org-mode has "M-", Evil-org has "M-k" - (kbd "M-l") 'outline-move-promote ; Org-mode has "M-", Evil-org has "M-l" - - (kbd "M-") 'outline-insert-heading)) ; Org-mode has "M-" - -(provide 'evil-outline) -;;; evil-outline.el ends here diff --git a/evil-p4.el b/evil-p4.el deleted file mode 100644 index 5fc222f..0000000 --- a/evil-p4.el +++ /dev/null @@ -1,55 +0,0 @@ -;;; evil-p4.el --- Evil bindings for P4 -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for P4. - -;;; Code: -(require 'p4 nil t) - -(defvar p4-basic-mode-map) - -(defun evil-p4-setup () - "Set up `evil' bindings for `p4'." - (evil-set-initial-state 'p4-basic-mode 'normal) - - (evil-define-key 'normal p4-basic-mode-map - [mouse-1] 'p4-buffer-mouse-clicked - "k" 'p4-scroll-down-1-line - "j" 'p4-scroll-up-1-line - (kbd "C-j") 'p4-forward-active-link - (kbd "C-k") 'p4-backward-active-link - (kbd "") '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)) - -;;; Code: -(provide 'evil-p4) -;;; evil-p4.el ends here diff --git a/evil-package-menu.el b/evil-package-menu.el deleted file mode 100644 index 3eb9123..0000000 --- a/evil-package-menu.el +++ /dev/null @@ -1,53 +0,0 @@ -;;; evil-package-menu.el --- Evil bindings for package-menu -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil integration for `package-menu-mode'. - -;;; Code: -(require 'evil) -(require 'package) - -(defun evil-package-menu-setup () - "Set up `evil' bindings for `package-menu'." - (evil-set-initial-state 'package-menu-mode 'motion) - - (evil-define-key 'motion package-menu-mode-map - "i" 'package-menu-mark-install - "U" 'package-menu-mark-upgrades - "d" 'package-menu-mark-delete - - ;; undo - "u" 'package-menu-mark-unmark - - ;; execute - "x" 'package-menu-execute - - ;; "q" 'quit-window ; macros can make sense here. - "ZQ" 'evil-quit - "ZZ" 'quit-window)) - -(provide 'evil-package-menu) -;;; evil-package-menu.el ends here diff --git a/evil-pass.el b/evil-pass.el deleted file mode 100644 index b2c7bd4..0000000 --- a/evil-pass.el +++ /dev/null @@ -1,57 +0,0 @@ -;;; evil-pass.el --- Evil bindings for pass-mode -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `pass-mode'. - -;;; Code: -(require 'evil-collection-util) -(require 'pass nil t) - -(defvar pass-mode-map) - -(defun evil-pass-setup () - "Set up `evil' bindings for `pass-mode'." - (evil-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 - "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-pass) -;;; evil-pass.el ends here diff --git a/evil-pdf.el b/evil-pdf.el deleted file mode 100644 index 58115f1..0000000 --- a/evil-pdf.el +++ /dev/null @@ -1,225 +0,0 @@ -;;; evil-pdf.el --- Evil bindings for pdf-tools -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for pdf-tools. - -;;; Code: -(require 'evil) -(require 'pdf-view nil t) - -(with-no-warnings - (defun evil-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))) - - (defun evil-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)))) - -(defun evil-pdf-setup () - "Set up `evil' bindings for `pdf-view'." - (evil-set-initial-state 'pdf-view-mode 'motion) - (evil-define-key 'motion pdf-view-mode-map - ;; motion - (kbd "") 'image-next-line - "j" 'pdf-view-next-line-or-next-page - "k" '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 "") '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 "") 'forward-page - (kbd "") 'backward-page - (kbd "") 'pdf-view-next-line-or-next-page - (kbd "") 'pdf-view-previous-line-or-previous-page - "gg" 'evil-pdf-view-goto-first-page - "G" 'evil-pdf-view-goto-page - - ;; mark - "'" 'pdf-view-jump-to-register - "m" 'pdf-view-position-to-register - - ;; zoom - "+" 'pdf-view-enlarge - "-" 'pdf-view-shrink - "0" 'pdf-view-scale-reset - "=" 'pdf-view-enlarge - - ;; 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 "") 'pdf-view-mouse-extend-region - (kbd "") 'pdf-view-mouse-set-region-rectangle - (kbd "") 'pdf-view-mouse-set-region - - (kbd "C-c C-c") 'docview-mode - (kbd "C-c ") '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 - - "y" 'pdf-view-kill-ring-save - - ;; search - (kbd "M-s o") 'pdf-occur ; TODO: More Evil bindings? - - "zd" 'pdf-view-dark-minor-mode - "zm" 'pdf-view-midnight-minor-mode - "zp" 'pdf-view-printer-minor-mode - - ;; quit - "q" 'quit-window - "Q" 'kill-this-buffer - "ZQ" 'kill-this-buffer - "ZZ" 'quit-window) - - (evil-set-initial-state 'pdf-outline-buffer-mode 'motion) - (evil-define-key 'motion pdf-outline-buffer-mode-map - ;; open - (kbd "") 'pdf-outline-follow-link-and-quit - (kbd "S-") 'pdf-outline-follow-link - (kbd "M-") '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-define-key 'motion pdf-occur-buffer-mode-map - ;; open - (kbd "") 'pdf-occur-goto-occurrence - (kbd "S-") '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 - "M" '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 "") 'tablist-unmark-backward - (kbd "S-SPC") 'scroll-down-command - (kbd "") 'tablist-backward-column - (kbd "C-c C-e") 'tablist-export-csv - - [remap evil-first-non-blank] 'tablist-move-to-major-columnj - [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-pdf) -;;; evil-pdf.el ends here diff --git a/evil-proced.el b/evil-proced.el deleted file mode 100644 index 441a4d4..0000000 --- a/evil-proced.el +++ /dev/null @@ -1,88 +0,0 @@ -;;; evil-proced.el --- Evil bindings for proced -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for proced. - -;;; Code: -(require 'evil) -(require 'proced) - -(defun evil-proced-setup () - (evil-set-initial-state 'proced-mode 'motion) - - (evil-define-key 'motion proced-mode-map - (kbd "") 'proced-refine - - ;; mark - ;; TODO: Implement a proced-toggle-mark? - "m" 'proced-mark ; Mentioned in documentation, should be followed. - "*" 'proced-mark-all - "M" '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 "") '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]order", 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-proced) -;;; evil-proced.el ends here diff --git a/evil-prodigy.el b/evil-prodigy.el deleted file mode 100644 index dca953d..0000000 --- a/evil-prodigy.el +++ /dev/null @@ -1,76 +0,0 @@ -;;; evil-prodigy.el --- Evil bindings for prodigy -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `prodigy'. - -;;; Code: -(require 'evil) -(require 'prodigy nil t) - -(defun evil-prodigy-setup () - "Set up `evil' bindings for `prodigy'." - (evil-define-key 'normal prodigy-mode-map - ;; quit - "q" 'quit-window - - "j" 'prodigy-next - "k" 'prodigy-prev - "gg" 'prodigy-first - "G" 'prodigy-last - - ;; TODO: Marking subject to change. - "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 "") '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-define-key 'normal prodigy-view-mode-map - "x" 'prodigy-view-clear-buffer)) - -(provide 'evil-prodigy) -;;; evil-prodigy.el ends here diff --git a/evil-profiler.el b/evil-profiler.el deleted file mode 100644 index d81111a..0000000 --- a/evil-profiler.el +++ /dev/null @@ -1,69 +0,0 @@ -;;; evil-profiler.el --- Evil bindings for profiler -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `profiler'. - -;;; Code: -(require 'evil) -(require 'profiler) - -(defun evil-profiler-setup () - "Set up `evil' bindings for `profiler'." - (evil-set-initial-state 'profiler-report-mode 'motion) - - (evil-define-key 'motion profiler-report-mode-map - ;; motion - (kbd "SPC") 'scroll-up-command - (kbd "S-SPC") 'scroll-down-command - (kbd "") 'scroll-down-command - "j" 'profiler-report-next-entry - "k" 'profiler-report-previous-entry - - (kbd "") 'profiler-report-toggle-entry - "i" '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 "") 'profiler-report-find-entry - - ;; refresh - "gr" 'revert-buffer - - ;; quit - "q" 'quit-window - "ZQ" 'evil-quit - "ZZ" 'quit-windw)) - -(provide 'evil-profiler) -;;; evil-profiler.el ends here diff --git a/evil-rtags.el b/evil-rtags.el deleted file mode 100644 index 8a92938..0000000 --- a/evil-rtags.el +++ /dev/null @@ -1,136 +0,0 @@ -;;; evil-rtags.el --- Evil bindings for `rtags'. -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;;; Evil bindings for `rtags'. - -;;; Code: -(require 'evil) -(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) - -(defun evil-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-define-key 'normal rtags-mode-map - ;; open - (kbd "") 'rtags-select - (kbd "S-") 'rtags-select-other-window - (kbd "M-") '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 ; TODO: Remove this binding? - - "c" 'rtags-select-caller - "C" 'rtags-select-caller-other-window - "x" 'rtags-select-and-remove-rtags-buffer - "q" 'rtags-call-bury-or-delete) - - (evil-define-key 'normal rtags-dependency-tree-mode-map - (kbd "TAB") 'rtags-dependency-tree-toggle-current-expanded - (kbd "E") 'rtags-dependency-tree-expand-all - (kbd "c") 'rtags-dependency-tree-collapse-all - (kbd "-") 'rtags-dependency-tree-collapse-current - (kbd "+") '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 "") 'rtags-select - (kbd "S-") 'rtags-select-other-window - (kbd "M-") '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) - - (evil-define-key 'normal rtags-references-tree-mode-map - (kbd "TAB") 'rtags-references-tree-toggle-current-expanded - - (kbd "E") 'rtags-references-tree-expand-all - (kbd "c") 'rtags-references-tree-collapse-all - (kbd "-") 'rtags-references-tree-collapse-current - (kbd "+") '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 "") 'rtags-select - (kbd "S-") 'rtags-select-other-window - (kbd "M-") '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) - - (evil-define-key 'normal rtags-location-stack-visualize-mode-map - ;; open - (kbd "") 'rtags-select - (kbd "S-") 'rtags-select-other-window - (kbd "M-") '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-rtags) -;;; evil-rtags.el ends here diff --git a/evil-slime.el b/evil-slime.el deleted file mode 100644 index 1f49a75..0000000 --- a/evil-slime.el +++ /dev/null @@ -1,105 +0,0 @@ -;;; evil-slime.el --- Evil bindings for `slime' -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `slime-mode'. - -;;; Code: -(require 'evil-collection-util) -(require 'slime nil t) - -(defvar sldb-mode-map) -(defvar slime-inspector-mode-map) - -(defun evil-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))) - -(defun evil-slime-setup () - "Set up `evil' bindings for `slime'." - (unless evil-move-beyond-eol - (advice-add 'slime-eval-last-expression :around 'evil-slime-last-sexp) - (advice-add 'slime-pprint-eval-last-expression :around 'evil-slime-last-sexp) - (advice-add 'slime-eval-print-last-expression :around 'evil-slime-last-sexp) - (advice-add 'slime-eval-last-expression-in-repl - :around 'evil-slime-last-sexp)) - - (evil-collection-util-evilify-map - sldb-mode-map - :mode sldb-mode - :bindings - "H" 'describe-mode - (kbd "C-j") 'sldb-down - (kbd "C-k") 'sldb-up - (kbd "M-j") 'sldb-details-down - (kbd "M-k") 'sldb-details-up - "gb" 'sldb-break-on-return - "gB" 'sldb-break-with-default-debugger) - - (evil-collection-util-evilify-map - slime-inspector-mode-map - :mode slime-inspector-mode - :bindings - ;; refresh - "gr" 'slime-inspector-reinspect) - - (evil-define-key 'normal slime-mode-map - (kbd "C-t") 'slime-pop-find-definition-stack - ;; goto - "gd" 'slime-edit-definition) - - (evil-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-set-initial-state 'slime-xref-mode 'normal) - (evil-define-key 'normal slime-xref-mode-map - (kbd "RET") 'slime-goto-xref - (kbd "S-") '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) - - (add-hook 'slime-popup-buffer-mode-hook #'evil-normalize-keymaps)) - -(provide 'evil-slime) -;;; evil-slime.el ends here diff --git a/evil-term.el b/evil-term.el deleted file mode 100644 index be2ff53..0000000 --- a/evil-term.el +++ /dev/null @@ -1,127 +0,0 @@ -;;; evil-term.el --- Evil bindings for term and ansi-term -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; 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) -(require 'term) - -;;; 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"? - -(defun evil-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-term-char-mode-insert () - "Switch to `term-char-mode' and enter insert state." - (interactive) - (term-char-mode) - (evil-insert-state)) - -(defun evil-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-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-term-char-mode-entry-function nil t) - (add-hook 'evil-insert-state-exit-hook 'term-line-mode nil t)) - -(defun evil-term-send-tab () - "Send tab in term mode." - (interactive) - (term-send-raw-string "\t")) - -(defun evil-term-setup () - "Set up `evil' bindings for `term'." - (evil-set-initial-state 'term-mode 'insert) - (add-hook 'term-mode-hook 'evil-term-sync-state-and-mode) - (add-hook 'term-mode-hook 'evil-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-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 "") 'evil-term-send-tab ; Should not be necessary. - (kbd "C-c C-d") 'term-send-eof - (kbd "C-c C-z") 'term-stop-subjob) - - (evil-define-key 'normal term-mode-map - (kbd "C-c C-k") 'evil-term-char-mode-insert - (kbd "") '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)) - -(provide 'evil-term) -;;; evil-term.el ends here diff --git a/evil-tide.el b/evil-tide.el deleted file mode 100644 index f3cc720..0000000 --- a/evil-tide.el +++ /dev/null @@ -1,61 +0,0 @@ -;;; evil-tide.el --- Bindings for `tide-mode'. -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;;; Bindings for `tide-mode'. - -;;; Code: -(require 'tide nil t) -(require 'evil) - -(defun evil-tide-setup () - "Set up `evil' bindings for `tide'." - (evil-define-key 'normal tide-mode-map - "gd" 'tide-jump-to-definition - (kbd "C-t") 'tide-jump-back - "K" 'tide-documentation-at-point) - - (evil-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 "C-m") 'tide-goto-reference - (kbd "") 'tide-goto-reference - ;; quit - "q" 'quit-window) - - (evil-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 "C-m") 'tide-goto-error - (kbd "") 'tide-goto-error - ;; quit - (kbd "q") 'quit-window)) - -(provide 'evil-tide) -;;; evil-tide.el ends here diff --git a/evil-transmission.el b/evil-transmission.el deleted file mode 100644 index 87ae5fc..0000000 --- a/evil-transmission.el +++ /dev/null @@ -1,144 +0,0 @@ -;;; evil-transmission.el --- Evil bindings for transmission.el -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - - -;;; Commentary: -;; Evil bindings for `transmission'. - -;;; Code: -(require 'evil) -(require 'transmission nil t) - -(defun evil-transmission-setup () - "Set up `evil' bindings for `transmission'." - (evil-set-initial-state 'transmission-mode 'motion) - (evil-define-key 'motion transmission-mode-map - ;; motion - (kbd "SPC") 'scroll-up-command - (kbd "S-SPC") 'scroll-down-command - (kbd "") 'scroll-down-command - - ;; sort - "o" 'tabulated-list-sort - - (kbd "") 'transmission-files - "p" 'transmission-peers - "i" 'transmission-info - - "a" 'transmission-add - ;; "D" 'transmission-delete ; Useless with `transmission-remove'? - "p" '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 - "M" 'transmission-unmark-all - "~" 'transmission-invert-marks - - ;; refresh - "gr" 'revert-buffer - - ;; quit - "q" 'transmission-quit - "ZQ" 'evil-quit - "ZZ" 'transmission-quit) - - (evil-set-initial-state 'transmission-files-mode 'motion) - (evil-define-key 'motion transmission-files-mode-map - (kbd "SPC") 'scroll-up-command - (kbd "S-SPC") 'scroll-down-command - (kbd "") 'scroll-down-command - - ;; sort - "o" 'tabulated-list-sort - - "p" 'transmission-peers - "i" 'transmission-info - - "R" 'transmission-move - "u" 'transmission-files-unwant - "U" 'transmission-files-want - "P" 'transmission-files-priority - - ;; open - (kbd "") 'transmission-find-file - (kbd "S-") 'transmission-find-file-other-window - (kbd "M-") '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-set-initial-state 'transmission-info-mode 'motion) - (evil-define-key 'motion 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 - "gy" 'transmission-copy-magnet ; TODO: Use "ym"? - "R" 'transmission-move - - ;; quit - "q" 'quit-window - "ZQ" 'evil-quit - "ZZ" 'quit-window) - - (evil-set-initial-state 'transmission-peers-mode 'motion) - (evil-define-key 'motion transmission-peers-mode-map - ;; sort - "o" 'tabulated-list-sort - - "i" 'transmission-info - - ;; quit - "q" 'quit-window - "ZQ" 'evil-quit - "ZZ" 'quit-window)) - -(provide 'evil-transmission) -;;; evil-transmission.el ends here diff --git a/evil-vlf.el b/evil-vlf.el deleted file mode 100644 index c7716bd..0000000 --- a/evil-vlf.el +++ /dev/null @@ -1,75 +0,0 @@ -;;; evil-vlf.el --- Evil bindings for vlf -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `vlf'. - -;;; Code: -(require 'evil-collection-util) -(require 'vlf nil t) - -(defvar vlf-mode-map) - -(defun evil-vlf-decrease-batch-size () - "Decrease vlf batch size by factor of 2." - (interactive) - (when (fboundp 'vlf-change-batch-size) - (vlf-change-batch-size t))) - -;;; Code: -(defun evil-vlf-setup () - "Set up `evil' bindings for `vlf'." - (evil-set-initial-state 'vlf-mode 'normal) - - (evil-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-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 ; TODO: This binding clashes with "open". Change? - "L" 'vlf-goto-line - "F" 'vlf-toggle-follow)) - -(provide 'evil-vlf) -;;; evil-vlf.el ends here diff --git a/evil-woman.el b/evil-woman.el deleted file mode 100644 index 60a6fba..0000000 --- a/evil-woman.el +++ /dev/null @@ -1,47 +0,0 @@ -;;; evil-woman.el --- Evil bindings for WoMan -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `woman'. - -;;; Code: -(require 'evil) -(require 'evil-man) ; WoMan's keymap inherits from Man. -(require 'woman) - -(defun evil-woman-setup () - "Set up `evil' bindings for `woman'." - (evil-define-key 'motion woman-mode-map - (kbd "]") 'WoMan-next-manpage - (kbd "[") 'WoMan-previous-manpage - - ;; goto - ;; "gm" 'woman - - ;; refresh - "gr" 'woman-reformat-last-file)) - -(provide 'evil-woman) -;;; evil-woman.el ends here diff --git a/evil-xref.el b/evil-xref.el deleted file mode 100644 index 7c5c65d..0000000 --- a/evil-xref.el +++ /dev/null @@ -1,52 +0,0 @@ -;;; evil-xref.el --- Evil bindings for xref -*- lexical-binding: t -*- - -;; Copyright (C) 2017 James Nguyen - -;; Author: James Nguyen -;; Maintainer: James Nguyen -;; Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for `xref'. - -;;; Code: -(require 'evil-collection-util) -(require 'xref) - -(defun evil-xref-setup () - "Set up `evil' bindings for `xref'." - (evil-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 - - ;; open - (kbd "") 'xref-goto-xref - (kbd "S-") 'xref-show-location-at-point - "o" 'xref-show-location-at-point ; TODO: Remove binding? - "go" 'xref-show-location-at-point)) - -(provide 'evil-xref) -;;; evil-xref.el ends here diff --git a/evil-ztree.el b/evil-ztree.el deleted file mode 100644 index b5c77b4..0000000 --- a/evil-ztree.el +++ /dev/null @@ -1,64 +0,0 @@ -;;; evil-ztree.el --- Evil bindings for ztree -*- lexical-binding: t -*- - -;; Copyright (C) 2017 Pierre Neidhardt - -;; Author: Pierre Neidhardt -;; Maintainer: James Nguyen , Pierre Neidhardt -;; URL: https://github.com/jojojames/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 . - -;;; Commentary: -;; Evil bindings for ztree. - -;;; Code: -(require 'evil) -(require 'ztree nil t) - -(defun evil-ztree-setup () - "Set up `evil' bindings for `ztree'." - (evil-set-initial-state 'ztree-mode 'motion) - - (evil-define-key 'motion ztree-mode-map - (kbd "") 'ztree-jump-side - (kbd "") '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-define-minor-mode-key 'motion '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-ztree) -;;; evil-ztree.el ends here diff --git a/readme.org b/readme.org index 97a3816..f76df2a 100644 --- a/readme.org +++ b/readme.org @@ -43,15 +43,15 @@ some default bindings to change in the future. or mode-by-mode, for instance: -: (with-eval-after-load 'calendar (require 'evil-calendar) (evil-calendar-setup)) +: (with-eval-after-load 'calendar (require 'evil-collection-calendar) (evil-collection-calendar-setup)) The list of supported modes is simply the list of files. If you want to enable Evil in the minibuffer, you'll have to turn it on explicitly. This is so because many users find it confusing. -: (require 'evil-minibuffer) -: (evil-minibuffer-init) +: (require 'evil-collection-minibuffer) +: (evil-collection-minibuffer-init) diff --git a/test/evil-collection-test.el b/test/evil-collection-test.el deleted file mode 100644 index 3c17b8a..0000000 --- a/test/evil-collection-test.el +++ /dev/null @@ -1,8 +0,0 @@ -;;; evil-collection-test.el --- Tests for evil-collection -*- lexical-binding: t -*- -(require 'evil-collection) - -(ert-deftest evil-collection-zero-test () - "Zero check blank test." - (should (equal 0 0))) - -;;; evil-collection-test.el ends here diff --git a/test/evilcol-test.el b/test/evilcol-test.el new file mode 100644 index 0000000..3c17b8a --- /dev/null +++ b/test/evilcol-test.el @@ -0,0 +1,8 @@ +;;; evil-collection-test.el --- Tests for evil-collection -*- lexical-binding: t -*- +(require 'evil-collection) + +(ert-deftest evil-collection-zero-test () + "Zero check blank test." + (should (equal 0 0))) + +;;; evil-collection-test.el ends here -- cgit v1.0