Kate editor's OCaml support is great!

In discussions about code editing environments for OCaml, I’ve rarely heard anyone mention Kate, the editor from the KDE project. But I just discovered that Kate’s OCaml support with its LSP client is quite good. I just needed to opam install ocaml-lsp-server and ocamlformat-rpc, and then everything just worked. It has all the typical features: show symbol type/docstring on hover, error highlighting and messages, jump to definition, plus a pop-open symbol outline. The editor also has git integration and project folder navigation.

Previously, I was happy with emacs+merlin, but sometimes I get tired of fighting emacs’ configuration, and that’s why I started searching and found this. I know most people are satisfied with VS Code, but Kate is more to my taste because it’s a desktop-native Qt app with a traditional-style GUI (with discoverable configuration dialogs!) It definitely starts up quicker.

I have no association with the Kate project, I just got excited. Does anyone else use it?


I’ve only passed by kate… and wrote it off as something with little support. But that was long ago considering now I use vis, tmuxed with a down repl haha.
it’d be interesting to hear the experience of someone using elementary’s custom editor too, I hear it’s comfy.

I’m a Vim + Merlin user and I second that. Kate + LSP + Vi mode is easy to set up and a viable alternative.

1 Like

You should try neovim + ocaml-lsp-server :eyes:

I’ve thought about it. I like the idea of Neovim, and I’m decent with vi keys, but don’t know if I’m ready to invest the effort to muscle-memorize all the other keybindings and commands for development. I used emacs for too long…

Thanks for bringing this up, I had no idea Kate had gotten so advanced and also ported over to Windows and Mac.

I’m trying it out now and it’s working great. Note for vim mode users on macOS, Ctrl-commands like Ctrl-F/B work with the Cmd key instead. And more generally for macOS, it doesn’t seem to respect my shell profile (incl. PATH variable) when launched using the application bundle, but does when launching from the command line.

And indeed you are right, it uses the ocamllsp server and works with OCaml out of the box, and it starts up super fast! I’ve been looking for something like this for a while, VSCode has been a little too heavy for my tastes lately.