Elixir editing on KDE’s Kate editor
Wandering through de depths of the internet, I saw a blog post that really picked my interest. KDE’s Kate status of its LSP Client plugin.
I am a big KDE fan. I really like the aesthetics of this DE and with Manjaro Linux I’ve settled for good with this setup. Up to date kernels, MESA, KDE and some other things things I love.
Being a true KDE fan, I always enjoy reading and following the project’s status reports. Nate Graham blog updates are always a joy to read. I’ve noticed they spent quite a lot of time on fixing, tweaking and extending a component called KTextEditor which is the basis of Kate, KDevelop and other tools around KDE land. So, when I’ve found out that Kate gained an LSP Client plugin I thought that it could run Elixir quite well.
This is the end result:
So, here it is how you setup Kate to edit Elixir code:
- Open up settings -> Configure Kate
- Plugins -> enable LSP Client plugin, apply and restart Kate
- Open up settings once again -> Configure Kate -> LSP Client
- Under the tab User Server Settings add this snippet (you need to have cloned elixir-ls somewhere and ran its build first):
{
"servers": {
"elixir-ls": {
"command": ["FULL PATH TO YOUR language_server.sh FILE"],
"rootIndicationFileNames": ["mix.exs"],
"url": "https://github.com/elixir-lsp/elixir-ls",
"highlightingModeRegex": "^(Elixir)$"
}
}
}
- Restart Kate
- Open any Elixir project (should start the LSP automatically)
- Make sure you configure your project going to: Tools -> Mode -> Sources -> Elixir
That’s it!
Kate is a very simple editor but really performant when compared with most others. Here is what I’ve tested with this setup:
- Auto-complete
- Code formatting (although couldn’t find a way to trigger format on save)
- Go to definition
Everything is working flawlessly and REALLY fast. This was quite a nice experience so far! Well done once again KDE developers :)
If you want to know more about Kate here are some links:
- Kate’s website: https://kate-editor.org
- Kate’s Elixir syntax highlighting source: https://kate-editor.org/syntax/data/syntax/elixir.xml (really concise if you compare it with other editors)
- Kate’s GIT repo: https://invent.kde.org/kde/kate
I’ve added a post on ElixirForum too to discuss about this further if anyone is interested.
LSP is surely changing the landscape of code editors. Kate which I thought of as a competitor to Notepad is actually a beast with the LSP plugin. And this is coming from a real die hard fan of Emacs…