2017-08-28 14:41:45 +00:00
|
|
|
;;; packages.el --- Clojure Layer packages File for Spacemacs
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2017-08-28 14:41:45 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2015-04-19 03:40:24 +00:00
|
|
|
(setq clojure-packages
|
2017-05-29 09:35:22 +00:00
|
|
|
'(
|
|
|
|
cider
|
|
|
|
cider-eval-sexp-fu
|
|
|
|
clj-refactor
|
2017-12-18 00:51:13 +00:00
|
|
|
clojure-cheatsheet
|
2017-05-29 09:35:22 +00:00
|
|
|
clojure-mode
|
2017-07-02 13:48:06 +00:00
|
|
|
(clojure-snippets :toggle (configuration-layer/layer-used-p 'auto-completion))
|
2017-05-29 09:35:22 +00:00
|
|
|
company
|
|
|
|
eldoc
|
2018-01-04 06:34:23 +00:00
|
|
|
evil-cleverparens
|
2017-05-29 09:35:22 +00:00
|
|
|
ggtags
|
2017-08-26 21:18:09 +00:00
|
|
|
counsel-gtags
|
2017-05-29 09:35:22 +00:00
|
|
|
helm-gtags
|
|
|
|
org
|
|
|
|
parinfer
|
|
|
|
popwin
|
|
|
|
sayid
|
|
|
|
smartparens
|
2017-12-18 00:51:13 +00:00
|
|
|
subword))
|
2017-05-29 09:35:22 +00:00
|
|
|
|
2014-12-11 12:07:49 +00:00
|
|
|
|
|
|
|
(defun clojure/init-cider ()
|
|
|
|
(use-package cider
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2014-12-11 12:07:49 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2016-01-26 16:31:15 +00:00
|
|
|
(spacemacs/register-repl 'cider 'cider-jack-in "cider")
|
2014-12-17 05:58:14 +00:00
|
|
|
(setq cider-stacktrace-default-filters '(tooling dup)
|
|
|
|
cider-repl-pop-to-buffer-on-connect nil
|
2015-02-02 23:07:29 +00:00
|
|
|
cider-prompt-save-file-on-load nil
|
2017-02-06 14:17:57 +00:00
|
|
|
cider-repl-use-clojure-font-lock t
|
|
|
|
cider-repl-history-file (concat spacemacs-cache-directory "cider-repl-history"))
|
2016-08-13 13:43:37 +00:00
|
|
|
(add-hook 'clojure-mode-hook 'cider-mode)
|
2016-09-04 16:24:43 +00:00
|
|
|
(dolist (x '(spacemacs-jump-handlers-clojure-mode
|
|
|
|
spacemacs-jump-handlers-clojurec-mode
|
|
|
|
spacemacs-jump-handlers-clojurescript-mode
|
|
|
|
spacemacs-jump-handlers-clojurex-mode
|
|
|
|
spacemacs-jump-handlers-cider-repl-mode))
|
2017-10-28 02:53:47 +00:00
|
|
|
(add-to-list x 'spacemacs/clj-find-var))
|
|
|
|
|
|
|
|
(add-hook 'clojure-mode-hook #'spacemacs//init-jump-handlers-clojure-mode)
|
|
|
|
(add-hook 'clojurescript-mode-hook #'spacemacs//init-jump-handlers-clojurescript-mode)
|
|
|
|
(add-hook 'clojurec-mode-hook #'spacemacs//init-jump-handlers-clojurec-mode)
|
|
|
|
(add-hook 'cider-repl-mode-hook #'spacemacs//init-jump-handlers-cider-repl-mode)
|
2017-05-30 09:58:17 +00:00
|
|
|
|
|
|
|
;; TODO: having this work for cider-macroexpansion-mode would be nice,
|
|
|
|
;; but the problem is that it uses clojure-mode as its major-mode
|
|
|
|
(let ((cider--key-binding-prefixes
|
|
|
|
'(("md" . "debug")
|
|
|
|
("me" . "evaluation")
|
2018-02-24 15:40:06 +00:00
|
|
|
("mf" . "format")
|
2017-05-30 09:58:17 +00:00
|
|
|
("mg" . "goto")
|
|
|
|
("mh" . "documentation")
|
2018-02-24 15:40:06 +00:00
|
|
|
("mp" . "profile")
|
2017-05-30 09:58:17 +00:00
|
|
|
("ms" . "repl")
|
|
|
|
("mt" . "test")
|
|
|
|
("mT" . "toggle")
|
2018-02-19 09:00:21 +00:00
|
|
|
)))
|
2017-05-30 09:58:17 +00:00
|
|
|
(dolist (m '(clojure-mode
|
|
|
|
clojurec-mode
|
|
|
|
clojurescript-mode
|
|
|
|
clojurex-mode
|
|
|
|
cider-repl-mode
|
|
|
|
cider-clojure-interaction-mode))
|
|
|
|
(mapc (lambda (x) (spacemacs/declare-prefix-for-mode
|
|
|
|
m (car x) (cdr x)))
|
|
|
|
cider--key-binding-prefixes)
|
|
|
|
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode m
|
|
|
|
"ha" 'cider-apropos
|
2018-02-24 15:40:06 +00:00
|
|
|
"hc" 'clojure-cheatsheet
|
2017-05-30 09:58:17 +00:00
|
|
|
"hg" 'cider-grimoire
|
2018-02-24 15:40:06 +00:00
|
|
|
"hh" 'cider-doc
|
2017-05-30 09:58:17 +00:00
|
|
|
"hj" 'cider-javadoc
|
|
|
|
"hn" 'cider-browse-ns
|
|
|
|
|
|
|
|
"e;" 'cider-eval-defun-to-comment
|
|
|
|
"eb" 'cider-eval-buffer
|
|
|
|
"ee" 'cider-eval-last-sexp
|
|
|
|
"ef" 'cider-eval-defun-at-point
|
|
|
|
"em" 'cider-macroexpand-1
|
|
|
|
"eM" 'cider-macroexpand-all
|
2017-06-20 21:53:01 +00:00
|
|
|
"eP" 'cider-pprint-eval-last-sexp
|
2018-02-24 15:40:06 +00:00
|
|
|
"er" 'cider-eval-region
|
2017-05-30 09:58:17 +00:00
|
|
|
"ew" 'cider-eval-last-sexp-and-replace
|
|
|
|
|
|
|
|
"=" 'cider-format-buffer
|
|
|
|
"fb" 'cider-format-buffer
|
|
|
|
|
|
|
|
"gb" 'cider-pop-back
|
|
|
|
"gc" 'cider-classpath
|
|
|
|
"ge" 'cider-jump-to-compilation-error
|
|
|
|
"gn" 'cider-browse-ns
|
|
|
|
"gN" 'cider-browse-ns-all
|
2018-02-24 15:40:06 +00:00
|
|
|
"gr" 'cider-find-resource
|
2018-02-19 09:00:21 +00:00
|
|
|
"gs" 'cider-browse-spec
|
|
|
|
"gS" 'cider-browse-spec-all
|
2017-05-30 09:58:17 +00:00
|
|
|
|
|
|
|
"'" 'cider-jack-in
|
|
|
|
"\"" 'cider-jack-in-clojurescript
|
|
|
|
"sb" 'cider-load-buffer
|
|
|
|
"sB" 'spacemacs/cider-send-buffer-in-repl-and-focus
|
|
|
|
"sc" (if (eq m 'cider-repl-mode)
|
|
|
|
'cider-repl-clear-buffer
|
|
|
|
'cider-connect)
|
|
|
|
"sC" 'cider-find-and-clear-repl-output
|
|
|
|
"se" 'spacemacs/cider-send-last-sexp-to-repl
|
|
|
|
"sE" 'spacemacs/cider-send-last-sexp-to-repl-focus
|
|
|
|
"sf" 'spacemacs/cider-send-function-to-repl
|
|
|
|
"sF" 'spacemacs/cider-send-function-to-repl-focus
|
|
|
|
"si" 'cider-jack-in
|
|
|
|
"sI" 'cider-jack-in-clojurescript
|
|
|
|
"sn" 'spacemacs/cider-send-ns-form-to-repl
|
|
|
|
"sN" 'spacemacs/cider-send-ns-form-to-repl-focus
|
|
|
|
"so" 'cider-repl-switch-to-other
|
|
|
|
"sq" 'cider-quit
|
|
|
|
"sr" 'spacemacs/cider-send-region-to-repl
|
|
|
|
"sR" 'spacemacs/cider-send-region-to-repl-focus
|
|
|
|
"ss" (if (eq m 'cider-repl-mode)
|
|
|
|
'cider-switch-to-last-clojure-buffer
|
|
|
|
'cider-switch-to-repl-buffer)
|
|
|
|
"sx" 'cider-refresh
|
2015-07-14 10:22:10 +00:00
|
|
|
"sX" 'cider-restart
|
2017-05-30 09:58:17 +00:00
|
|
|
|
|
|
|
"Te" 'cider-enlighten-mode
|
|
|
|
"Tf" 'spacemacs/cider-toggle-repl-font-locking
|
|
|
|
"Tp" 'spacemacs/cider-toggle-repl-pretty-printing
|
|
|
|
"Tt" 'cider-auto-test-mode
|
|
|
|
|
|
|
|
"ta" 'spacemacs/cider-test-run-all-tests
|
|
|
|
"tb" 'cider-test-show-report
|
|
|
|
"tl" 'spacemacs/cider-test-run-loaded-tests
|
|
|
|
"tn" 'spacemacs/cider-test-run-ns-tests
|
2018-02-24 15:40:06 +00:00
|
|
|
"tp" 'spacemacs/cider-test-run-project-tests
|
2017-05-30 09:58:17 +00:00
|
|
|
"tr" 'spacemacs/cider-test-rerun-failed-tests
|
|
|
|
"tt" 'spacemacs/cider-test-run-focused-test
|
|
|
|
|
|
|
|
"db" 'cider-debug-defun-at-point
|
|
|
|
"de" 'spacemacs/cider-display-error-buffer
|
|
|
|
"dv" 'cider-inspect
|
|
|
|
|
2018-02-19 09:00:21 +00:00
|
|
|
;; profile
|
2018-02-24 15:40:06 +00:00
|
|
|
"p+" 'cider-profile-samples
|
2018-02-19 09:00:21 +00:00
|
|
|
"pc" 'cider-profile-clear
|
|
|
|
"pn" 'cider-profile-ns-toggle
|
2018-02-24 15:40:06 +00:00
|
|
|
"ps" 'cider-profile-var-summary
|
|
|
|
"pS" 'cider-profile-summary
|
|
|
|
"pt" 'cider-profile-toggle
|
2018-02-19 09:00:21 +00:00
|
|
|
"pv" 'cider-profile-var-profiled-p
|
|
|
|
|
2017-05-30 09:58:17 +00:00
|
|
|
;; refactorings from clojure-mode
|
|
|
|
"rc#" 'clojure-convert-collection-to-set
|
2018-02-24 15:40:06 +00:00
|
|
|
"rc'" 'clojure-convert-collection-to-quoted-list
|
|
|
|
"rc(" 'clojure-convert-collection-to-list
|
|
|
|
"rc:" 'clojure-toggle-keyword-string
|
2017-07-13 16:09:41 +00:00
|
|
|
"rc[" 'clojure-convert-collection-to-vector
|
2018-02-24 15:40:06 +00:00
|
|
|
"rc{" 'clojure-convert-collection-to-map
|
|
|
|
)))
|
2017-05-30 09:58:17 +00:00
|
|
|
|
|
|
|
;; cider-repl-mode only
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'cider-repl-mode
|
|
|
|
"," 'cider-repl-handle-shortcut)
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'cider-clojure-interaction-mode
|
|
|
|
"ep" 'cider-eval-print-last-sexp))
|
2014-12-11 12:07:49 +00:00
|
|
|
:config
|
|
|
|
(progn
|
2015-02-24 01:52:49 +00:00
|
|
|
;; add support for golden-ratio
|
2015-09-29 05:07:57 +00:00
|
|
|
(with-eval-after-load 'golden-ratio
|
2018-06-01 06:59:57 +00:00
|
|
|
(add-to-list 'golden-ratio-extra-commands 'cider-popup-buffer-quit-function))
|
2015-02-24 01:52:49 +00:00
|
|
|
;; add support for evil
|
2015-12-15 21:36:18 +00:00
|
|
|
(evil-set-initial-state 'cider-stacktrace-mode 'motion)
|
|
|
|
(evil-set-initial-state 'cider-popup-buffer-mode 'motion)
|
2015-08-18 12:39:25 +00:00
|
|
|
(add-hook 'cider--debug-mode-hook 'spacemacs/cider-debug-setup)
|
|
|
|
|
2015-11-21 10:07:14 +00:00
|
|
|
(evilified-state-evilify cider-stacktrace-mode cider-stacktrace-mode-map
|
|
|
|
(kbd "C-j") 'cider-stacktrace-next-cause
|
|
|
|
(kbd "C-k") 'cider-stacktrace-previous-cause
|
|
|
|
(kbd "TAB") 'cider-stacktrace-cycle-current-cause
|
|
|
|
(kbd "0") 'cider-stacktrace-cycle-all-causes
|
|
|
|
(kbd "1") 'cider-stacktrace-cycle-cause-1
|
|
|
|
(kbd "2") 'cider-stacktrace-cycle-cause-2
|
|
|
|
(kbd "3") 'cider-stacktrace-cycle-cause-3
|
|
|
|
(kbd "4") 'cider-stacktrace-cycle-cause-4
|
|
|
|
(kbd "5") 'cider-stacktrace-cycle-cause-5
|
|
|
|
(kbd "a") 'cider-stacktrace-toggle-all
|
|
|
|
(kbd "c") 'cider-stacktrace-toggle-clj
|
|
|
|
(kbd "d") 'cider-stacktrace-toggle-duplicates
|
|
|
|
(kbd "J") 'cider-stacktrace-toggle-java
|
|
|
|
(kbd "r") 'cider-stacktrace-toggle-repl
|
|
|
|
(kbd "T") 'cider-stacktrace-toggle-tooling)
|
2015-03-24 14:32:33 +00:00
|
|
|
|
2015-04-02 18:53:43 +00:00
|
|
|
;; open cider-doc directly and close it with q
|
|
|
|
(setq cider-prompt-for-symbol nil)
|
2015-08-14 10:11:29 +00:00
|
|
|
|
2015-11-21 10:07:14 +00:00
|
|
|
(evilified-state-evilify cider-docview-mode cider-docview-mode-map
|
|
|
|
(kbd "q") 'cider-popup-buffer-quit)
|
|
|
|
|
|
|
|
(evilified-state-evilify cider-inspector-mode cider-inspector-mode-map
|
|
|
|
(kbd "L") 'cider-inspector-pop
|
|
|
|
(kbd "n") 'cider-inspector-next-page
|
2017-08-28 14:57:38 +00:00
|
|
|
(kbd "N") 'cider-inspector-prev-page
|
|
|
|
(kbd "p") 'cider-inspector-prev-page
|
2015-11-21 10:07:14 +00:00
|
|
|
(kbd "r") 'cider-inspector-refresh)
|
|
|
|
|
|
|
|
(evilified-state-evilify cider-test-report-mode cider-test-report-mode-map
|
|
|
|
(kbd "C-j") 'cider-test-next-result
|
|
|
|
(kbd "C-k") 'cider-test-previous-result
|
|
|
|
(kbd "RET") 'cider-test-jump
|
|
|
|
(kbd "d") 'cider-test-ediff
|
|
|
|
(kbd "e") 'cider-test-stacktrace
|
|
|
|
(kbd "q") 'cider-popup-buffer-quit
|
|
|
|
(kbd "r") 'cider-test-rerun-tests
|
|
|
|
(kbd "t") 'cider-test-run-test
|
2016-02-15 11:10:50 +00:00
|
|
|
(kbd "T") 'cider-test-run-ns-tests)
|
2015-08-14 10:11:29 +00:00
|
|
|
|
2015-08-14 09:58:45 +00:00
|
|
|
(evil-define-key 'normal cider-repl-mode-map
|
2016-11-18 15:00:47 +00:00
|
|
|
(kbd "C-j") 'cider-repl-next-input
|
2018-05-23 06:06:09 +00:00
|
|
|
(kbd "C-k") 'cider-repl-previous-input)
|
2018-05-23 20:27:20 +00:00
|
|
|
|
2018-05-23 06:06:09 +00:00
|
|
|
(evil-define-key 'insert cider-repl-mode-map
|
|
|
|
(kbd "C-j") 'cider-repl-next-input
|
2016-11-18 15:00:47 +00:00
|
|
|
(kbd "C-k") 'cider-repl-previous-input)
|
2015-08-14 09:58:45 +00:00
|
|
|
|
2015-03-05 21:56:11 +00:00
|
|
|
(when clojure-enable-fancify-symbols
|
2016-03-07 23:14:21 +00:00
|
|
|
(clojure/fancify-symbols 'cider-repl-mode)
|
|
|
|
(clojure/fancify-symbols 'cider-clojure-interaction-mode)))
|
2015-04-29 11:11:22 +00:00
|
|
|
|
2016-02-15 19:15:29 +00:00
|
|
|
(defadvice cider-jump-to-var (before add-evil-jump activate)
|
|
|
|
(evil-set-jump))))
|
2014-12-11 12:07:49 +00:00
|
|
|
|
2015-04-05 03:25:11 +00:00
|
|
|
(defun clojure/init-cider-eval-sexp-fu ()
|
2015-09-29 05:07:57 +00:00
|
|
|
(with-eval-after-load 'eval-sexp-fu
|
|
|
|
(require 'cider-eval-sexp-fu)))
|
2015-04-05 03:25:11 +00:00
|
|
|
|
2014-12-11 12:07:49 +00:00
|
|
|
(defun clojure/init-clj-refactor ()
|
2015-08-14 09:57:24 +00:00
|
|
|
(use-package clj-refactor
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-08-14 09:57:24 +00:00
|
|
|
:init
|
|
|
|
(add-hook 'clojure-mode-hook 'clj-refactor-mode)
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(cljr-add-keybindings-with-prefix "C-c C-f")
|
|
|
|
|
2017-05-30 09:58:17 +00:00
|
|
|
;; Usually we do not set keybindings in :config, however this must be done
|
|
|
|
;; here because it reads the variable `cljr--all-helpers'. Since
|
|
|
|
;; `clj-refactor-mode' is added to the hook, this should trigger when a
|
|
|
|
;; clojure buffer is opened anyway, so there's no "keybinding delay".
|
|
|
|
(let ((clj-refactor--key-binding-prefixes
|
|
|
|
'(("mr" . "refactor")
|
|
|
|
("mra" . "add")
|
|
|
|
("mrc" . "cycle/clean/convert")
|
|
|
|
("mrd" . "destructure")
|
|
|
|
("mre" . "extract/expand")
|
|
|
|
("mrf" . "find/function")
|
|
|
|
("mrh" . "hotload")
|
|
|
|
("mri" . "introduce/inline")
|
|
|
|
("mrm" . "move")
|
|
|
|
("mrp" . "project/promote")
|
|
|
|
("mrr" . "remove/rename/replace")
|
|
|
|
("mrs" . "show/sort/stop")
|
|
|
|
("mrt" . "thread")
|
|
|
|
("mru" . "unwind/update"))))
|
|
|
|
(dolist (m '(clojure-mode
|
|
|
|
clojurec-mode
|
|
|
|
clojurescript-mode
|
|
|
|
clojurex-mode
|
|
|
|
cider-repl-mode
|
|
|
|
cider-clojure-interaction-mode))
|
|
|
|
(mapc (lambda (x) (spacemacs/declare-prefix-for-mode
|
|
|
|
m (car x) (cdr x)))
|
|
|
|
clj-refactor--key-binding-prefixes)
|
|
|
|
(dolist (r cljr--all-helpers)
|
|
|
|
(let* ((binding (car r))
|
|
|
|
(func (cadr r)))
|
|
|
|
(when (not (string-prefix-p "hydra" (symbol-name func)))
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode m
|
|
|
|
(concat "r" binding) func)))))))))
|
2015-02-20 04:37:06 +00:00
|
|
|
|
2017-12-18 00:51:13 +00:00
|
|
|
(defun clojure/init-clojure-cheatsheet ()
|
|
|
|
(use-package clojure-cheatsheet
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2017-12-18 00:51:13 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq sayid--key-binding-prefixes
|
|
|
|
'(("mhc" . "clojure-cheatsheet")))
|
|
|
|
(dolist (m '(clojure-mode
|
|
|
|
clojurec-mode
|
|
|
|
clojurescript-mode
|
|
|
|
clojurex-mode
|
|
|
|
cider-repl-mode
|
|
|
|
cider-clojure-interaction-mode))
|
|
|
|
(mapc (lambda (x) (spacemacs/declare-prefix-for-mode
|
|
|
|
m (car x) (cdr x)))
|
|
|
|
sayid--key-binding-prefixes)
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode m
|
|
|
|
"hc" 'clojure-cheatsheet)))))
|
|
|
|
|
2015-02-20 04:41:20 +00:00
|
|
|
(defun clojure/init-clojure-mode ()
|
|
|
|
(use-package clojure-mode
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-07-07 14:15:46 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.boot\\'" . clojure-mode))
|
2016-05-05 21:38:13 +00:00
|
|
|
;; This regexp matches shebang expressions like `#!/usr/bin/env boot'
|
2017-05-30 09:58:17 +00:00
|
|
|
(add-to-list 'magic-mode-alist '("#!.*boot\\s-*$" . clojure-mode))
|
2015-09-04 17:11:04 +00:00
|
|
|
(dolist (m '(clojure-mode clojurec-mode clojurescript-mode clojurex-mode))
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode m
|
2017-05-30 09:58:17 +00:00
|
|
|
"fl" 'clojure-align)))
|
|
|
|
:config
|
|
|
|
(when clojure-enable-fancify-symbols
|
|
|
|
(dolist (m '(clojure-mode clojurescript-mode clojurec-mode clojurex-mode))
|
|
|
|
(clojure/fancify-symbols m)))))
|
2015-07-26 05:18:16 +00:00
|
|
|
|
2016-04-11 18:30:47 +00:00
|
|
|
(defun clojure/post-init-eldoc ()
|
|
|
|
(add-hook 'cider-mode-hook 'eldoc-mode)
|
2016-03-07 23:14:21 +00:00
|
|
|
(add-hook 'cider-repl-mode-hook 'eldoc-mode)
|
|
|
|
(add-hook 'cider-clojure-interaction-mode-hook 'eldoc-mode))
|
2016-04-11 18:30:47 +00:00
|
|
|
|
2018-01-04 06:34:23 +00:00
|
|
|
(defun clojure/pre-init-evil-cleverparens ()
|
|
|
|
(spacemacs|use-package-add-hook evil-cleverparens
|
|
|
|
:pre-init
|
2018-01-22 11:40:06 +00:00
|
|
|
(dolist (m '(clojure-mode
|
|
|
|
clojurec-mode
|
|
|
|
clojurescript-mode
|
|
|
|
clojurex-mode))
|
|
|
|
(add-to-list 'evil-lisp-safe-structural-editing-modes m))))
|
2018-01-04 06:34:23 +00:00
|
|
|
|
2015-07-26 05:18:16 +00:00
|
|
|
(defun clojure/pre-init-popwin ()
|
|
|
|
(spacemacs|use-package-add-hook popwin
|
|
|
|
:post-config
|
|
|
|
(push '("*cider-error*" :dedicated t :position bottom :stick t :noselect nil :height 0.4)
|
2015-07-26 05:22:13 +00:00
|
|
|
popwin:special-display-config)
|
|
|
|
(push '("*cider-doc*" :dedicated t :position bottom :stick t :noselect nil :height 0.4)
|
2015-07-26 05:18:16 +00:00
|
|
|
popwin:special-display-config)))
|
|
|
|
|
2018-03-04 04:37:53 +00:00
|
|
|
(defun clojure/post-init-smartparens ()
|
|
|
|
(add-hook 'cider-repl-mode-hook
|
|
|
|
(if dotspacemacs-smartparens-strict-mode
|
|
|
|
#'smartparens-strict-mode
|
|
|
|
#'smartparens-mode))
|
|
|
|
(with-eval-after-load 'smartparens
|
|
|
|
(sp-local-pair 'clojure-mode "`" nil :actions nil)))
|
2016-06-11 16:41:20 +00:00
|
|
|
|
2015-08-09 03:35:16 +00:00
|
|
|
(defun clojure/post-init-subword ()
|
2016-03-15 03:17:09 +00:00
|
|
|
(add-hook 'cider-mode-hook 'subword-mode))
|
2015-04-03 22:33:37 +00:00
|
|
|
|
2016-05-30 02:39:21 +00:00
|
|
|
(defun clojure/post-init-company ()
|
2017-01-02 05:39:04 +00:00
|
|
|
(spacemacs|add-company-backends
|
|
|
|
:backends company-capf
|
|
|
|
:modes
|
2017-01-06 21:21:45 +00:00
|
|
|
cider-mode
|
|
|
|
cider-repl-mode))
|
2016-02-28 08:28:12 +00:00
|
|
|
|
2016-04-05 04:08:34 +00:00
|
|
|
(defun clojure/post-init-ggtags ()
|
2016-08-15 19:24:44 +00:00
|
|
|
(add-hook 'clojure-mode-local-vars-hook #'spacemacs/ggtags-mode-enable))
|
2016-04-05 04:08:34 +00:00
|
|
|
|
2017-08-26 21:18:09 +00:00
|
|
|
(defun clojure/post-init-counsel-gtags ()
|
|
|
|
(spacemacs/counsel-gtags-define-keys-for-mode 'clojure-mode))
|
|
|
|
|
2016-04-05 04:08:34 +00:00
|
|
|
(defun clojure/post-init-helm-gtags ()
|
|
|
|
(spacemacs/helm-gtags-define-keys-for-mode 'clojure-mode))
|
|
|
|
|
2016-02-28 08:28:12 +00:00
|
|
|
(defun clojure/init-clojure-snippets ()
|
|
|
|
(use-package clojure-snippets
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t))
|
2016-10-04 21:17:13 +00:00
|
|
|
|
|
|
|
(defun clojure/pre-init-org ()
|
|
|
|
(spacemacs|use-package-add-hook org
|
|
|
|
:post-config (add-to-list 'org-babel-load-languages '(clojure . t))
|
|
|
|
(setq org-babel-clojure-backend 'cider)))
|
2017-01-18 11:27:08 +00:00
|
|
|
|
|
|
|
(defun clojure/init-sayid ()
|
|
|
|
(use-package sayid
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2017-01-18 11:27:08 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq sayid--key-binding-prefixes
|
|
|
|
'(("mdt" . "trace")))
|
|
|
|
(dolist (m '(clojure-mode
|
|
|
|
clojurec-mode
|
|
|
|
clojurescript-mode
|
|
|
|
clojurex-mode
|
|
|
|
cider-repl-mode
|
|
|
|
cider-clojure-interaction-mode))
|
|
|
|
(mapc (lambda (x) (spacemacs/declare-prefix-for-mode
|
|
|
|
m (car x) (cdr x)))
|
|
|
|
sayid--key-binding-prefixes)
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode m
|
|
|
|
;;These keybindings mostly preserved from the default sayid bindings
|
|
|
|
"d!" 'sayid-load-enable-clear
|
2018-02-24 15:40:06 +00:00
|
|
|
"dE" 'sayid-eval-last-sexp ;in default sayid bindings this is lowercase e, but that was already used in clojure mode
|
2017-01-18 11:27:08 +00:00
|
|
|
"dc" 'sayid-clear-log
|
2018-02-24 15:40:06 +00:00
|
|
|
"df" 'sayid-query-form-at-point
|
|
|
|
"dh" 'sayid-show-help
|
2017-01-18 11:27:08 +00:00
|
|
|
"ds" 'sayid-show-traced
|
|
|
|
"dS" 'sayid-show-traced-ns
|
|
|
|
"dtb" 'sayid-trace-ns-in-file
|
|
|
|
"dtd" 'sayid-trace-fn-disable
|
|
|
|
"dtD" 'sayid-trace-disable-all
|
2018-02-24 15:40:06 +00:00
|
|
|
"dte" 'sayid-trace-fn-enable
|
|
|
|
"dtE" 'sayid-trace-enable-all
|
|
|
|
"dtK" 'sayid-kill-all-traces
|
2017-01-18 11:27:08 +00:00
|
|
|
"dtn" 'sayid-inner-trace-fn
|
|
|
|
"dto" 'sayid-outer-trace-fn
|
2018-02-24 15:40:06 +00:00
|
|
|
"dtp" 'sayid-trace-ns-by-pattern
|
2017-01-18 11:27:08 +00:00
|
|
|
"dtr" 'sayid-remove-trace-fn
|
2018-02-24 15:40:06 +00:00
|
|
|
"dty" 'sayid-trace-all-ns-in-dir
|
|
|
|
"dV" 'sayid-set-view
|
|
|
|
"dw" 'sayid-get-workspace
|
|
|
|
"dx" 'sayid-reset-workspace
|
|
|
|
))
|
2017-01-18 11:27:08 +00:00
|
|
|
|
|
|
|
(evilified-state-evilify sayid-mode sayid-mode-map
|
|
|
|
(kbd "H") 'sayid-buf-show-help
|
|
|
|
(kbd "n") 'sayid-buffer-nav-to-next
|
|
|
|
(kbd "N") 'sayid-buffer-nav-to-prev
|
|
|
|
(kbd "C-s v") 'sayid-toggle-view
|
|
|
|
(kbd "C-s V") 'sayid-set-view
|
|
|
|
(kbd "L") 'sayid-buf-back
|
2017-05-29 09:35:22 +00:00
|
|
|
(kbd "e") 'sayid-gen-instance-expr) ;Originally this was bound to 'g', but I feel this is still mnemonic and doesn't overlap with evil
|
|
|
|
|
2017-01-18 11:27:08 +00:00
|
|
|
(evilified-state-evilify sayid-pprint-mode sayid-pprint-mode-map
|
|
|
|
(kbd "h") 'sayid-pprint-buf-show-help
|
|
|
|
(kbd "n") 'sayid-pprint-buf-next
|
|
|
|
(kbd "N") 'sayid-pprint-buf-prev
|
|
|
|
(kbd "l") 'sayid-pprint-buf-exit)
|
|
|
|
|
|
|
|
(evilified-state-evilify sayid-traced-mode sayid-traced-mode-map
|
|
|
|
(kbd "l") 'sayid-show-traced
|
|
|
|
(kbd "h") 'sayid-traced-buf-show-help))))
|
2017-05-29 09:35:22 +00:00
|
|
|
|
|
|
|
(defun clojure/post-init-parinfer ()
|
2017-05-29 14:52:39 +00:00
|
|
|
(dolist (m '(clojure-mode-hook
|
|
|
|
clojurec-mode-hook
|
|
|
|
clojurescript-mode-hook
|
|
|
|
clojurex-mode-hook))
|
2017-05-29 09:35:22 +00:00
|
|
|
(add-hook m 'parinfer-mode)))
|