2017-11-07 11:04:12 +01:00
|
|
|
;;; evil-cider.el --- Evil bindings for Cider -*- lexical-binding: t -*-
|
2017-11-05 17:57:45 +01:00
|
|
|
|
|
|
|
;; Copyright (C) 2017 James Nguyen
|
|
|
|
|
|
|
|
;; Author: James Nguyen <james@jojojames.com>
|
|
|
|
;; Maintainer: James Nguyen <james@jojojames.com>
|
2017-11-07 11:04:12 +01:00
|
|
|
;; Pierre Neidhardt <ambrevar@gmail.com>
|
2017-11-05 17:57:45 +01:00
|
|
|
;; 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
;;; Commentary:
|
2017-11-07 11:04:12 +01:00
|
|
|
;; Evil bindings for Cider.
|
2017-11-05 17:57:45 +01:00
|
|
|
|
|
|
|
;;; Code:
|
2017-11-15 10:12:24 +01:00
|
|
|
(require 'cider nil t)
|
2017-11-05 17:57:45 +01:00
|
|
|
(require 'evil-collection-util)
|
|
|
|
|
2017-11-07 02:39:23 +01:00
|
|
|
(defun evil-cider-setup ()
|
2017-11-17 03:53:35 +01:00
|
|
|
"Set up `evil' bindings for `cider'."
|
2017-11-14 19:23:46 +01:00
|
|
|
(evil-define-key '(normal visual) cider-mode-map
|
2017-11-27 05:00:34 +01:00
|
|
|
"gd" 'cider-find-var
|
|
|
|
(kbd "C-t") 'cider-pop-back
|
2017-11-23 14:26:45 +01:00
|
|
|
"gz" 'cider-switch-to-repl-buffer
|
|
|
|
"gf" 'cider-find-resource
|
|
|
|
"K" 'cider-doc)
|
2017-11-05 17:57:45 +01:00
|
|
|
|
|
|
|
(with-eval-after-load 'cider-repl
|
2017-11-14 19:23:46 +01:00
|
|
|
(evil-define-key '(normal visual) cider-repl-mode-map
|
2017-11-27 05:00:34 +01:00
|
|
|
"gd" 'cider-find-var
|
|
|
|
(kbd "C-t") 'cider-pop-back
|
|
|
|
"gr" 'cider-refresh
|
2017-11-23 14:26:45 +01:00
|
|
|
"gf" 'cider-find-resource
|
|
|
|
"K" 'cider-doc))
|
2017-11-05 17:57:45 +01:00
|
|
|
|
|
|
|
(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
|
2017-11-27 08:16:45 +01:00
|
|
|
(kbd "M-p") 'cider-test-previous-result
|
|
|
|
(kbd "M-n") 'cider-test-next-result
|
2017-11-23 14:26:45 +01:00
|
|
|
|
|
|
|
;; goto
|
2017-11-27 08:16:45 +01:00
|
|
|
"gd" 'cider-test-jump
|
|
|
|
|
|
|
|
(kbd "<backtab>") 'cider-test-previous-result
|
|
|
|
(kbd "<tab>") 'cider-test-next-result
|
|
|
|
(kbd "<return>") '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))
|
2017-11-05 17:57:45 +01:00
|
|
|
|
|
|
|
(with-eval-after-load 'cider-macroexpansion
|
|
|
|
(evil-define-key 'normal cider-macroexpansion-mode-map
|
2017-11-23 14:26:45 +01:00
|
|
|
;; quit
|
2017-11-27 08:16:45 +01:00
|
|
|
"q" 'cider-popup-buffer-quit-function
|
2017-11-23 14:26:45 +01:00
|
|
|
|
2017-11-27 08:16:45 +01:00
|
|
|
"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))
|
2017-11-05 17:57:45 +01:00
|
|
|
|
|
|
|
(with-eval-after-load 'cider-client
|
|
|
|
(evil-define-key 'normal cider-connections-buffer-mode-map
|
2017-11-27 08:16:45 +01:00
|
|
|
"d" 'cider-connections-make-default
|
|
|
|
"c" 'cider-connection-browser
|
|
|
|
"x" 'cider-connections-close-connection
|
|
|
|
(kbd "<return>") 'cider-connections-goto-connection
|
|
|
|
"g?" 'describe-mode)))
|
2017-11-05 17:57:45 +01:00
|
|
|
|
|
|
|
(provide 'evil-cider)
|
|
|
|
;;; evil-cider.el ends here
|