Clojure Development In Emacs

This is a guide for setting up Clojure development via Cider in Doom Emacs.

First things first, if you havent Install Doom Emacs.

In your .doom.d/init.el file, head down the the :lang section and uncomment clojure. The Clojure module adds these github link packages to your emacs:

Enable Linting

This is done via flycheck-clj-kondo. Enabling clj-kondo requires that you have syntax under :checkers in your init file enabled.

Enabling Auto Complete (Laguage Server Protocol or LSP)

In your .doom.d/init.el, pass your clojure option a +lsp like so:

(clojure +lsp)

Under :tools you must un-comment lsp. Next, and this was the part that I didnt realize at first, you must install clojure-lsp github link on your machine. You can do this via brew brew link if you are on MacOS:

brew install clojure-lsp

Another option would be to add an alias to your ~/.clojure/deps.edn:

{:aliases
{:lsp {:extra-deps {snoe/clojure-lsp {:git/url "https://github.com/snoe/clojure-lsp" :sha "a90836ce5a50147347a55001505cc29bbe171dc1"}}
:main-opts ["-m" "clojure-lsp.main"]
:jvm-opts ["-Xmx1g" "-server"]}}}

And then you can run the lsp server with clojure -A:lsp. Github Link