dotfiles/emacs/.emacs.d/config/init-clojure.el

55 lines
1.3 KiB
EmacsLisp
Raw Normal View History

;; -*- 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)
:general
(cider-stacktrace-mode-map "SPC" leader-map)
2021-02-21 16:28:54 +00:00
(normal cider-mode-map "M-." #'cider-find-var)
(cider-mode-map "C-c t" cider-test-commands-map
"C-c M-b" #'cider-debug-defun-at-point)
(cider-repl-mode-map "C-c C-l" #'cider-repl-clear-buffer)
(normal cider--debug-mode-map "," cider--debug-mode-map))
(provide 'init-clojure)