From fb4571a464568352595f884eb4a7c6728339311d Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Sun, 27 Sep 2026 20:03:45 -0500 Subject: [PATCH] feat(elixir): add Expert, Treesitter and credo support Use Expert, the official Elixir language server, with the elixir, heex and eex parsers, markdown highlighting for Livebook files, and credo linting in projects that have a .credo.exs. This stands in for LazyVim's elixir extra. Its nvim-lint opts assign linters_by_ft outright, which drops every linter configured before it; enabling it removed the dockerfile and fish linters. Register the Livebook language from an opts function, since lazy.nvim keeps only the last init for a plugin and xaml.lua already sets one. --- lua/plugins/elixir.lua | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lua/plugins/elixir.lua diff --git a/lua/plugins/elixir.lua b/lua/plugins/elixir.lua new file mode 100644 index 0000000..e692edc --- /dev/null +++ b/lua/plugins/elixir.lua @@ -0,0 +1,34 @@ +-- Stands in for LazyVim's elixir extra, whose nvim-lint opts replace +-- linters_by_ft outright and drop every linter configured before it. +return { + { + "nvim-treesitter/nvim-treesitter", + -- A function rather than init: lazy.nvim keeps only the last init for a + -- plugin, and xaml.lua sets one too. + opts = function(_, opts) + vim.treesitter.language.register("markdown", "livebook") + vim.list_extend(opts.ensure_installed, { "elixir", "heex", "eex" }) + end, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + expert = {}, + }, + }, + }, + { + "mfussenegger/nvim-lint", + opts = { + linters_by_ft = { elixir = { "credo" } }, + linters = { + credo = { + condition = function(ctx) + return vim.fs.find({ ".credo.exs" }, { path = ctx.filename, upward = true })[1] ~= nil + end, + }, + }, + }, + }, +}