victorolinasc

victorolinasc

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.

First 3 of 3 Posts! Switch mode

guibbv20111

guibbv20111

Lexical works fine too…

Eiji

Eiji

In general I like how much apps KDE/Plasma have, but …

  1. They have 2 editors (kate and kwrite)
  2. Modern code editor is pretty specific topic, a good editor like kate cannot be compared to editors like zed which are very specialised in terms of performance (including UI rendering on GPU)

As above both editors are good, but most likely for new developers that want to have a same UI style for all apps. A senior developers would rather choose an IDE or an editor on which maintainers are fully focused. Therefore currently Sublime Text 4 looks best (in terms of performance), but VS Code have also it’s place. A song of future (near future) is zed. I believe that the potential of it is not yet fully used, but even now it’s a powerful tool much better than a “typical” DE editor with plugin support.

It does not really matter. The point is how fast it’s at runtime. Before zed I was testing lots of editors and IDEs checking how long they need to load a project with a huge JSON database (at that time I was using HDD). The only one who really passed it was Sublime Text 3 (at that time there was no version 4). In some other cases editors often had a problem with freezing UI (that’s why I was so interested in zed before even they have started to support Linux).

If not now then I believe that zed would not have a worth opponents in at least few years as most editors are using an existing GTK+ / Qt API, so rewriting them is not so easy.

ArthurClemens

ArthurClemens

I had quite some problems getting this to run on a Mac with asdf. The elixir-ls launch script could not find asdf when ran inside Kate, because ASDF_DIR was pointing to my home directory, while asdf was installed with Homebrew.
In the end I re-installed asdf using “the preferred method” (using Git) and things are working fine now.

Where Next?

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2976 91332 914
New
f0rest8
Hi everyone :waving_hand: Posting here to showcase and announce that Metamorphic is now officially live on a public-facing domain at htt...
New
byu
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project. My initial shotgu...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
AstonJ
Just a general thread to post chat/news/info relating to AI/ML stuff that may be relevant for Nx now or in the future. Got anything to sh...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
zachdaniel
Introducing AshStorage! Attachment and file management that slots directly into your resources :smiling_face_with_sunglasses: I had hope...
New

We're in Beta

About us Mission Statement