diff options
author | Linnnus <[email protected]> | 2023-10-30 13:51:49 +0100 |
---|---|---|
committer | Linnnus <[email protected]> | 2023-10-30 13:51:49 +0100 |
commit | 426b7728eb7b408ff763d34b130589cfd3538fd8 (patch) | |
tree | 6dbd82649445af7624aefc5d493b03064151ee7a /home/neovim/plugins.nix | |
parent | 1d256f99ddd40b63b9be5c014c6855e2c2df8391 (diff) |
home/neovim: add clojure support
Diffstat (limited to 'home/neovim/plugins.nix')
-rw-r--r-- | home/neovim/plugins.nix | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/home/neovim/plugins.nix b/home/neovim/plugins.nix index 1e0a707..2610141 100644 --- a/home/neovim/plugins.nix +++ b/home/neovim/plugins.nix @@ -1,9 +1,6 @@ # This module sets up and configures various miscellaneous plugins. -{ - pkgs, - lib, - ... -}: { +# TODO: I fear this file will become the utils.lua of my Neovim configuration. Remove it! +{pkgs, ...}: { programs.neovim.plugins = [ { plugin = pkgs.vimPlugins.vim-localvimrc; @@ -25,5 +22,30 @@ map T <Plug>Sneak_T ''; } + { + # Add interactive repl-like environment. + # See also the addition of cmp-conjure in `completion.nix`. + # See also the addition of clojure in `dev-utils/default.nix`. + plugin = pkgs.vimPlugins.conjure; + type = "lua"; + config = '' + -- Create a command to launch NRepl for Clojure support. + -- See: https://github.com/Olical/conjure/wiki/Quick-start:-Clojure + vim.api.nvim_create_user_command("NRepl", function() + local id = vim.fn.jobstart({ + "${pkgs.clojure}/bin/clj", + "-Sdeps", + '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.40.0"}}}', + "--main", + "nrepl.cmdline", + "--middleware", + '["cider.nrepl/cider-middleware"]', + "--interactive", + }) + end, { + desc = "Starts an NRepl session in the current directory (for use w/ conjure).", + }) + ''; + } ]; } |