EOS: Clojure Development Module

Table of Contents

(provide 'eos-clojure)

Clojure

Things for Clojure development, which I do a lot of.

(defun eos/clojure-things-hook ()
  "Set up clojure-y things"
  (eldoc-mode 1)
  (subword-mode t)
  (paredit-mode 1)
  (global-set-key (kbd "C-c t") 'clojure-jump-between-tests-and-code))

(use-package clojure-mode
  :ensure t
  :init
  (add-hook #'clojure-mode-hook #'eos/clojure-things-hook))

Let's define a couple of helper functions for setting up the cider:

(defun eos/setup-cider ()
  (interactive)
  (setq cider-history-file "~/.nrepl-history"
        cider-hide-special-buffers t
        cider-repl-history-size 10000
        cider-prefer-local-resources t
        cider-popup-stacktraces-in-repl t)
  (paredit-mode 1)
  (eldoc-mode 1))

And then finally use them if cider and ac-nrepl packages are available:

(use-package cider
  :ensure t
  :defer 30
  :init
  (add-hook #'cider-mode-hook #'eos/setup-cider)
  (add-hook #'cider-repl-mode-hook #'eos/setup-cider)
  (add-hook #'cider-mode-hook #'eos/clojure-things-hook)
  (add-hook #'cider-repl-mode-hook #'eos/clojure-things-hook))

For looking up documentation, helm-clojuredocs is neat and handy

(use-package helm-clojuredocs
  :ensure t)

Author: Lee Hinman

Created: 2017-08-21 Mon 14:28