diff --git a/evil-alchemist.el b/evil-alchemist.el new file mode 100644 index 0000000..333d321 --- /dev/null +++ b/evil-alchemist.el @@ -0,0 +1,102 @@ +;;; 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 + +;; 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 + "h" '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-collection.el b/evil-collection.el index db017ad..e538dda 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -36,6 +36,7 @@ ;;; Code: (defvar evil-collection-mode-list `(ag + alchemist anaconda-mode arc-mode bookmark