Asynchronous Clojure Interactive Development
Acid.nvim is a plugin for clojure development on neovim. It was initially designed within iron.nvim, but evolved to be a proper clojure plugin for neovim.
It is built fundamentally on neovims async capabilities and rely deeply on clojures refactor-nrepl and nrepl-python-client.
First, install the python dependencies:
pip3 install --user neovim
Update your ~/.lein/profiles.clj
adding the following lines:
[refactor-nrepl "2.3.0-SNAPSHOT"]
[cider/cider-nrepl "0.14.0"]
Then, add and install acid:
Plug 'clojure-vim/acid.nvim'
" Since acid is a remote plugin, its bindings must be generated by neovim.
:UpdateRemotePlugins
Acid is a remote plugin. This means it communicates with neovim using the rpc interface. For its commands to be available on neovim, one must first update neovims rpc bindings:
:UpdateRemotePlugins
Acid has some commands for interacting with the nrepl.
Currently, there is no documentation for those commands, but a few are worth mentioning here:
<leader>N
Creates a new fileK
Shows documentation for the symbol below cursorcar
Requires current filecaR
Requires dependency line below cursor (i.e.[clojure.string :as str]
)gu
Shows usage of symbol below cursorgd
Goes to definition of symbol below cursorcp<motion>
Sends the block to nrepl for evaluationcpp
Shorthand mapping for evaluating the whole block below cursor (up until the outermost)
All those are defined as Commands as well:
AcidNewFile <ns.file>
Creates a new file under supplied ns.name.AcidNewFilePrompt
Prompts for the full filename for creation.AcidLoadAll
Loads all project namespaces into the nrepl for easier navigation.AcidRequire [<require> [<options>]]
Requires a namespace.- If no parameters supplied, loads current ns.
- Arguments supplied can be the same as a require vector, taking options:
AcidRequire clojure.string :as str
AcidRequire clojure.string :refer [join]
AcidDoc <ns/symbol>
Shows the documentation of the supplied symbol.
There are a few more which are unstable and/or incomplete.
Take a look at the design page for a better understanding on how acid works.
Acid is growing up in both complexity and features and there is still a lot of work to be done. Please take a look at the TODO for the roadmap.