dotfiles/emacs/.emacs.d/config/init-clojure.el
2021-02-27 21:56:57 -05:00

55 lines
1.4 KiB
EmacsLisp

;; -*- 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))
:config
(evil-collection-cider-setup)
(general-def cider-mode-map "C-c t" cider-test-commands-map)
(general-def normal cider--debug-mode-map "," cider--debug-mode-map)
:general
(cider-stacktrace-mode-map "SPC" leader-map)
(normal cider-mode-map "M-." #'cider-find-var)
(cider-mode-map "C-c M-b" #'cider-debug-defun-at-point)
(cider-repl-mode-map "C-c C-l" #'cider-repl-clear-buffer))
(provide 'init-clojure)