Mon, 26 Jun 2023 14:10:36 -0500
Add elixir-tools.nvim
.config/nvim/lua/plugins/filetype.lua | file | annotate | diff | comparison | revisions |
--- a/.config/nvim/lua/plugins/filetype.lua +++ b/.config/nvim/lua/plugins/filetype.lua @@ -39,4 +39,35 @@ return { "asciidoc/vim-asciidoc", { "vim-perl/vim-perl", branch = "dev" }, "yko/mojo.vim", + + -- Because of Elixir/OTP mismatches, this is more reliable than Mason for + -- elixir-ls + { + "elixir-tools/elixir-tools.nvim", + version = "*", + event = { "BufReadPre", "BufNewFile" }, + config = function() + local elixir = require("elixir") + local elixirls = require("elixir.elixirls") + + elixir.setup({ + credo = {}, + elixirls = { + enable = true, + settings = elixirls.settings({ + dialyzerEnabled = false, + enableTestLenses = false, + }), + on_attach = function(client, bufnr) + vim.keymap.set("n", "<leader>fp", ":ElixirFromPipe<cr>", { buffer = true }) + vim.keymap.set("n", "<leader>tp", ":ElixirToPipe<cr>", { buffer = true }) + vim.keymap.set("v", "<leader>em", ":ElixirExpandMacro<cr>", { buffer = true }) + end, + }, + }) + end, + dependencies = { + "nvim-lua/plenary.nvim", + }, + }, }