2021-02-21 03:01:34 +00:00
|
|
|
;; -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
;; Clojure configuration
|
|
|
|
(use-package clojure-mode
|
|
|
|
:mode (("\\.clj\\'" . clojure-mode)
|
|
|
|
("\\.cljs\\'" . clojurescript-mode)
|
|
|
|
("\\.cljc\\'" . clojurec-mode)
|
|
|
|
("\\.edn\\'" . clojure-mode))
|
|
|
|
:config
|
|
|
|
(define-clojure-indent
|
|
|
|
(defroutes 'defun)
|
|
|
|
(GET 2)
|
|
|
|
(POST 2)
|
|
|
|
(PUT 2)
|
|
|
|
(DELETE 2)
|
|
|
|
(HEAD 2)
|
|
|
|
(ANY 2)
|
|
|
|
(OPTIONS 2)
|
|
|
|
(PATCH 2)
|
|
|
|
(rfn 2)
|
|
|
|
(let-routes 1)
|
|
|
|
(context 2)
|
|
|
|
(:= 3)
|
|
|
|
(:+ 3)
|
|
|
|
(match 1)
|
|
|
|
(for-all 2)
|
|
|
|
(checking 2)
|
|
|
|
(let-flow 1)))
|
|
|
|
|
|
|
|
;; Flycheck support
|
|
|
|
(use-package flycheck-clj-kondo
|
|
|
|
:after (clojure-mode)
|
|
|
|
:if (executable-find "clj-kondo"))
|
|
|
|
|
|
|
|
(use-package cider
|
|
|
|
:commands (cider-mode cider-jack-in cider-jack-in-clojurescript)
|
|
|
|
:custom
|
|
|
|
(cider-known-endpoints
|
|
|
|
'(("local" "localhost" "4005")))
|
|
|
|
(cider-prompt-for-symbol nil)
|
|
|
|
:hook ((clojure-mode . cider-mode)
|
|
|
|
(clojurescript-mode . cider-mode)
|
|
|
|
(clojurec-mode . cider-mode))
|
2021-02-21 16:28:54 +00:00
|
|
|
:config
|
|
|
|
(evil-collection-cider-setup)
|
2021-02-23 17:14:20 +00:00
|
|
|
(general-def cider-mode-map "C-c t" cider-test-commands-map)
|
2021-02-28 02:56:57 +00:00
|
|
|
(general-def normal cider--debug-mode-map "," cider--debug-mode-map)
|
2021-02-21 03:01:34 +00:00
|
|
|
:general
|
|
|
|
(cider-stacktrace-mode-map "SPC" leader-map)
|
2021-02-21 16:28:54 +00:00
|
|
|
(normal cider-mode-map "M-." #'cider-find-var)
|
2021-02-23 17:14:20 +00:00
|
|
|
(cider-mode-map "C-c M-b" #'cider-debug-defun-at-point)
|
|
|
|
(cider-repl-mode-map "C-c C-l" #'cider-repl-clear-buffer))
|
2021-02-21 03:01:34 +00:00
|
|
|
|
|
|
|
(provide 'init-clojure)
|