As a less mainstream language, Erlang doesn’t generally have a great out-of-the-box developer experience. As someone new to Erlang (and the BEAM in general), who also uses Neovim as their daily driver, I wanted to see whether I could setup a functional Neovim configuration that would give me IDE-like features for Erlang. I specifically wanted the following:
Code formatting on save
Hover documentation
Goto definition
Code actions
Quickly jumping to workspace symbols
Luckily, there is an erlang language server which has pretty much everything you need out of the box. Once you install it (and erlang_ls is in your $PATH), configuring it for Neovim is actually pretty simple. I adapted my OCaml configuration a bit, and it resulted in something that worked. The plugin spec is as follows.
You can import it like a normal lua module and call setup where necessary. Personally, I use AstroNvim, so I added it to the config table as follows:
Anyway, I know this was short, but I thought this was cool and might help someone else in the future. Also, it’s been two weeks since I’ve written a post and I don’t want the two people who read this blog to think I’ve abandoned it (I haven’t!). See you next time (: