Elixir editing on KDE's Kate editor (with elixir-ls integration)

Hey there people :slight_smile:

Just wanted to share a very quick and easy setup for editing Elixir in KDE’s Kate editor. This is a very nice and simple editor. It starts real fast and is quite easy on memory and cpu.

Here is a screenshot of it working with elixir-ls and syntax highlighting:

To configure it is very easy:

  • 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 of User Server Settings add this snippet (you need to have cloned elixir-ls 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 :slight_smile:

What I’ve tested:

  • Auto-complete
  • Code formatting (although couldn’t find a way to trigger format on save)
  • Go to definition

I don’t use it on a daily basis, but it is an awesome fully open source alternative to add in the mix. Auto-completion, code formatting and all working fine with just these settings. I am an Emacs user but its nice to have an alternative that is native to my DE.

For those interested, here are some links:

Anyway, just wanted to share this little snippet. I’ve seen some other KDE fans around here so that might make em happy too.

5 Likes