(Neo)vim and language servers

There is a thread about vim already, but I wanted to start one specifically about the language server.

What configuration do people use for integrating elixir-ls in vim? Are the integrations worth using?

Specifically, the elixir-ls readme suggests three options:

  1. ALE
  2. elixir-lsp/coc-elixir
  3. vim-lsp

I’ve already read Mitchell Hanberg (ALE), Hauleth (vim-lsp) and David Bernheisel (coc-elixir)'s blog posts - but they are from 2018, 2019 and 2020 respectively, and all recommend different implementations. I was wondering if there have been more developments in the last few years that may change the recommendations, and if there is any de-facto standard?

Personally I was thinking of trying vim-lsp, but thought I’d check for a consensus before I go down the rabbit hole.


If you’re using neovim, the neovim lsp is recommended since it’s built-in lsp integration for neovim since 0.5. It’s quite faster than the list above since it’s written in C + some Lua code (i believe). You just to install the neovim-lspconfig GitHub - neovim/nvim-lspconfig: Quickstart configurations for the Nvim LSP client to pre config lsp server that you want to use, elixir-ls already included.

But if you’re prefer vim-lsp, vim-lsp-settings GitHub - mattn/vim-lsp-settings: Auto configurations for Language Server for vim-lsp is recommended.


Thanks wingyplus - no preference! I will check out neovim-lspconfig.

1 Like

Another nice thing with using the built-in lsp client is that it integrates nicely with telescope , which makes it easy to navigate through documents/workspace symbols/diagnostics. Of course if you don’t use/like telescope, then it’s not really relevant.

Apart from that, if you’re ok with experimental features, nvim-treesitter is a good addition to the setup, but it does require to work with nvim HEAD, which hasn’t eaten any of my code up until now.

The only issue I faced with this setup, is I forgot to set the terminal to bash in my init.lua, and fish (my main terminal) doesn’t play well at all with vim/nvim and can render everything crippling slow.


Just wanted to mention I still didn’t get this set up as well as I’d like. Although the language-server is running, I don’t have auto-completion working yet, and the configuration for options you need to provide to nvim-lspconfig are quite overwhelming. I just asked a question over on Stack Overflow about how to get this set up. I’m hoping somebody will spell it out before I eventually get around to working it all out!

I started writing a quick start guide (as mentioned here) but ran into issues with lspconfig too, so ended up installing Spacevim, which works but feels slower than Spacemacs (so I uninstalled it). The reason I wanted to use Neovim is because I wanted something that felt really snappy!

So currently I am leaning towards Doom Emacs - it’s much easier to set-up, feels pretty solid, and Emacs actually has some really nice features (as mentioned in this DT thread). People (or at least the person in that vid) says that once you know the basics of Vim then it’s a good time to transition to Emacs in Evil mode (i.e Doom Emacs or Spacemacs).

I’d still be interested in trying to get a working ‘fast’ Neovim set up tho… perhaps we can start a thread in members-only to work on putting together a step-by-step guide?


I just made a guide on how to set up neovim for elixir development from scratch, hope that you will find it helpful!


After months of head-scratching and procrastinating over getting nvim-lspconfig set up property, I set up coc.nvim this morning in a couple of hours and it all works magically. Most of the defaults were what I wanted, and I only had to add about 5 lines of config. :h coc-nvim has all the documentation you need. It was also only a couple of commands to get language servers working with with json, typescript, etc. too. I wish I’d started with coc.nvim from the beginning!

Also: I tend to run two buffers side-by-side, and the way warnings are displayed with the built-in lsp support is that they are appended to the end of the line - often falling of the screen. coc.nvim’s implementation shows the warnings in a popup when you focus on them, which works better. The native version is probably configurable, but coc.vim’s defaults worked well for me.


That’s how I felt when I went to coc :lol:

I think my current fave is just using LunarVim… as mentioned in @TunkShif’s set-up from scratch guide: Neovim - Elixir Setup Configuration from Scratch Guide

1 Like