From 7f1a07c7caa2b1c2b1b32d6464cf017424455650 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 12 May 2024 15:19:50 -0700 Subject: [PATCH] add elixir tools --- lua/plugins/lsp.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index a3e3401..7c8cb03 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -4,6 +4,35 @@ return { dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" }, opts = {}, }, + { + "elixir-tools/elixir-tools.nvim", + version = "*", + event = { "BufReadPre", "BufNewFile" }, + config = function() + local elixir = require("elixir") + local elixirls = require("elixir.elixirls") + + elixir.setup({ + nextls = { enable = true }, + credo = {}, + elixirls = { + enable = true, + settings = elixirls.settings({ + dialyzerEnabled = false, + enableTestLenses = false, + }), + 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, + }, + }) + end, + dependencies = { + "nvim-lua/plenary.nvim", + }, + }, { "neovim/nvim-lspconfig", opts = {