From f5c9c70b0829cda68415f5fb154dd59da618e143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 14 Dec 2024 22:53:54 +0100 Subject: [PATCH] feat(nvim): add elixir tools nvim --- modules/programs/nvim/new_plugins/lsp.nix | 31 +++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/modules/programs/nvim/new_plugins/lsp.nix b/modules/programs/nvim/new_plugins/lsp.nix index afc64ab..1a6400a 100644 --- a/modules/programs/nvim/new_plugins/lsp.nix +++ b/modules/programs/nvim/new_plugins/lsp.nix @@ -5,6 +5,34 @@ let in { home-manager.users.moritz.programs.nixvim = { + extraPlugins = with pkgs.vimPlugins; [ + elixir-tools-nvim + ]; + + extraConfigLuaPost = '' + local elixir = require("elixir") + local elixirls = require("elixir.elixirls") + + elixir.setup { + nextls = { + enable = true, + }, + elixirls = { + enable = true, + cmd = vim.fn.exepath("elixir-ls"), + settings = elixirls.settings { + dialyzerEnabled = true, + enableTestLenses = true, + }, + on_attach = function(client, bufnr) + vim.keymap.set("n", "fp", ":ElixirFromPipe", { buffer = true, noremap = true }) + vim.keymap.set("n", "tp", ":ElixirToPipe", { buffer = true, noremap = true }) + vim.keymap.set("v", "em", ":ElixirExpandMacro", { buffer = true, noremap = true }) + end, + }, + } + ''; + plugins.lsp = { enable = true; inlayHints = true; @@ -12,9 +40,8 @@ in enable = true; installRustc = false; installCargo = false; + settings.files.watcher = "server"; }; - servers.elixirls.enable = true; - servers.nextls.enable = true; servers.nil_ls.enable = true; servers.nixd.enable = true; servers.nixd.extraOptions.settings.nixd = {