With nvim-lspconfig, the instructions for setting up elixir-ls say:
- Download the zip from Release Release v0.26.0 · elixir-lsp/elixir-ls · GitHub
- Unzip it and make it executable.
unzip elixir-ls.zip -d /path/to/elixir-ls # Unix chmod +x /path/to/elixir-ls/language_server.sh
By default, elixir-ls doesn’t have a
cmd
set. This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to setcmd
to the absolute path ($HOME and ~ are not expanded) of your unzipped elixir-ls.require'lspconfig'.elixirls.setup{ -- Unix cmd = { "/path/to/elixir-ls/language_server.sh" }; -- Windows cmd = { "/path/to/elixir-ls/language_server.bat" }; ... }
Installing the elixir-ls package via nixpkgs, finding it and the path to language_server.sh within it on the nix store, and pasting that path on the config does not work. Can’t run chmod +x /path/to/elixir-ls/language_server.sh
on the nix store, either. I tried manually downloading and extracting another copy of it on another random folder, following the instructions for that one and passing that path to the config instead, and it still doesn’t work ^^;
I am definitelty not savvy enough to figure out how to go about this… does anyone know an easy way to set up elixir-ls for Neovim on NixOS?