Recently I gave up on configuring
spacevim over and over, and I decided to try emacs... a piece of tech I have avoided for over 20 years. My goal was to have something that worked out of the box, with all the nice stuff that vim provides. After some searching I found doom emacs so I installed emacs for the first time in my live in my 20+ years of *nix, ops and programming career.
So first things first;
doom emacs is freaking amazing, now I feel bad for all the time I wasted tuning vim and vscode, with doom 99% of the things worked out of the box, some minor relearning was needed, but was some love at first sight kind of thing, only thing left was having full integration with my favourite programming language elixir to have a nice IDE like experience
So I began reading how to integrate elixir and I found a lot of tutorials but seems like doom moves fast and almost of all them were outdated, did not work and were quite long. So here is they simplest way i have found to integrate elixir-ls with doom emacs and turned out it was super simple.
git clone https://github.com/elixir-lsp/elixir-ls.git ~/.elixir-ls cd ~/.elixir-ls mix deps.get mix compile mix elixir_ls.release -o release
Add elixir-ls to your
in your shell rc, in my case
I use a mac so the
emacs.app starts isolated and the
PATH is not the same as the one in your shell. Also i almost never start emacs from the command line so the path to the elixir-ls has to be in your doom
you can validate that the
elixir-ls path is in
lsp and replace
elixir as follows
lsp (elixir +lsp)
restart emacs... profit
you should see a little 🚀 (rocket) in your status bar that means is connected to the lsp server, and you get auto-complete and all other good stuff.
you can use
SPC b B and search for a buffer
*lsp-log* to see error messages
This gives the basic set up to start working, you can customize the
lsp-ui but I dont know how and Im not that interested in fine tuning every single piece of it. This is enough to get me up and running.
Also make sure you keep your elixir-ls up to date. And if you have multiple
erlang/OTP versions is very likely you will need a compiled elixir-lsp to each specific version.
If you know useful cool tricks for doom+elixir please do share them! Im kind of new in this :D