"Vim, Emacs and other Editors"

Introduction

Hi everyone,

In the last few days, I was looking for a nice editor for OCaml development. Currently, and for the last 5 or 6 years or so, I have been using Emacs with the Doom configuration (+ Vim keybinds, because they are pretty great). This worked very well for me because I wrote a lot of Common Lisp code, and there is no better development environment than Emacs + Sly/Slime for Common Lisp. However, in the last few months, I’ve written less and less Lisp code and more and more OCaml code. This made me reconsider my choice of editor because Emacs is a bulky beast.

Emacs is a great operating system, lacking only a decent editor. - Vim users

The LSP integration I used was a pretty miserable experience because it was painfully slow. So I went on a journey to explore alternatives to Emacs.

The best-case scenario would be an editor running in a terminal that is configurable and responsive, especially with LSP servers. Let's first rule out some broadly used editors and then look at some real contenders.

Visual Studio Code / Cursor AI / Sublime / Atom / ...

The first editor that pops up in recommendations across the web is VS Code, and with the rise of AI, also Cursor AI. But there is no way I’m switching from something like Emacs, which is bulky because it has LOTS of features, to an Electron app that is bulky because it runs in a Chromium tab. Also, I don't want any AI feature in my code editor (that's a 100% deal breaker for me).

Vim / Neovim

First of all, I want to apologize to all Vim users because I use Vim and Neovim interchangeably. I am used to the keybindings because I used Emacs with Evil mode for a long time, so there were no real new bindings to learn. No problem on that front. But where I ran into real problems was with the configuration. There are really good packages out there for Vim, but the installation process is a bit convoluted if you are accustomed to the Emacs way. First, you have to load a package manager, from which there are about 1,728 (exaggeration!) options, and afterwards, you have to create .lua files for each plugin you want. This feels a bit strange coming from Emacs, where you just do package-install <package-name> (to be fair, you have to configure a package manager first, but there is only one big one). Then you have to do strange things with the Lua language (or just normal things with this language, but I have zero experience with it, so it looks strange to me :P) to configure the plugins. But after setting things up, it is blazing fast. I also see an advantage in the plugin management: you can just pull your plugin folder from your Git repository and load all plugins from a declarative configuration.

Helix

Helix looked pretty nice because I love my SPC leader key, and Helix comes with it by default. It's super fast, the scripting language is Scheme (which I love), and the default settings are sane. But currently, it lacks proper plugin support. At least, I couldn’t get it to run. So I’ll have to come back in a few years, I guess. But I’ll check it out now and then.

Self-Configured Emacs

My last idea is to self-configure Emacs starting from vanilla Emacs with Evil mode. This would be a lot of work, but I am very comfy in Emacs, and it is the editor that I have been using for years now.

Conclusion

Based on my research, I can’t use stuff like VS Code, Cursor AI, Sublime, and Atom because they don't solve the problem I am trying to solve and introduce things I don’t want. After ruling out the obvious outliers, we have a tight competition between Vim and Emacs (because Helix is not there yet, sorry!). Which makes sense because those are the two big players in the nerd editor war out there. Vim is super fast but, for me, a bit hard to configure; Emacs is slower but easier to configure (at least for me, because I am experienced with it). So what I’m doing now is trying to boost the Emacs LSP performance a bit by trying out Doom Emacs with eglot, lsp-booster, or/and lsp-bridge, and I hope it makes the development experience fluent again. If this doesn’t work, I’ll try to roll my own configuration from scratch, hoping that gets me there. And if all fails, I’ll have to learn Lua and configure Vim. So for now, I’ll stay with Doom Emacs and tinker a bit more with the LSP connection. If something changes, I’ll let you know.

Have a good one!