Rewiring

Neovim just clicks

I've been a very happy Rider user for many years - and still am! It's an excellent IDE for .NET work, with most batteries included, and most of those batteries (debugger, http client, integrated terminal, AI Assistant...) of very high quality. I was very content - until I brushed on the dark temptation of vim...

For many developers the first and only touch point to vim is as the default commit message tool in git, and the only question becomes "how do I exit this and never touch it again?". Mine too, mine too. When I later started paying more attention to my work ergonomics, the idea of doing more and more work on just the keyboard became very attractive, and that is where vim shines.

IdeaVim as a gateway drug

IdeaVim is a plugin that brings vim to JetBrains editors, allowing the keyboard usage of vim within the comfy confines of the IDE. It's relatively easy to bind editor actions, like 'run/debug the current configuration' or 'set a breakpoint here' with the config file (you can see mine here). That means that you can 'subvert' the editor default keymaps in a more vim-like, modal way.

This is a good solution, but ultimately it started to chafe a bit. For example, the keymaps don't work in most of the menus or come into effect at all unless a text file is active. All in all, I felt like using a shoe-in inside a larger system - which is true, of course.

However, I was hooked on the actual text editing side. If only the editor was built with vim in mind...

A Personal Development Environment

I happened to stumble on a Developer voices episode (Youtube, Spotify), in which TJ DeVries, a key contributor of Neovim, talked about the philosophy of a 'Personal Development Environment' (in contrast to an IDE, an Integrated Development Environment, like Rider), where the developer can build her own environment on a good but rather empty canvas.

I'd been hesitant about e.g. VS Code, with the approach of 'this is a text editor, make an IDE of it with plugins' and the subsequent configuration and supply chain issues, but something in the way that TJ talked toggled a switch on my brain, and I had to give it a try.

Deeper waters - LazyVim, Kickstart

One of the easiest ways to get started with Neovim is LazyVim, which is very much a 'Neovim distribution with batteries included'. Being a very lazy person, I supposed that it would be a perfect match for me.

Very quickly, though, it started feeling really crowded. It has a lot of bells and whistles, the vast majority of which I did not need, at least at the start when I was new to the whole ecosystem. TJ mentioned another, simpler, from-the-basics approach provided by kickstart.nvim which encourages the user to go through and understand each piece, yet at the end providing a basic working setup that's easy to start expanding.

The light

After some fiddling I had a decently working setup for dotnet and was finally able to start using it for actual development on my projects. I've now been doing more and more dev work on Neovim for a couple of weeks and it feels so good - the performance, the navigation, the editing... I guess the good vibes come mainly from two points: the feeling of control and the joy of learning.

The control comes from this being my canvas - I don't even have a markdown renderer, and come to think on it, have I ever needed one in my editor? The IDEs like Rider and Visual Studio bundle in a lot of functionality I've never needed (or known existed), so why pay the startup/performance penalty for those?

Learning, tweaking and customizing is a joy in itself. For example, here's the things I picked up when writing this short piece:

I think I'll write a more detailed piece about doing dotnet development with Neovim on WSL2, but for now I'll just refer to my config if you're interested in seeing the kind of setup I'm currently using.

I still reach for Rider by reflex when I know I have to be extra efficient, but I feel like in half a year it will be the other way around.

The shadow

It's not all bliss, of course. I'm most worried about the plugin security, especially since most of mine are just pointing to a main branch on a git repo. Standard stuff for plugin ecosystems, and currently attackers seem to target VSCode, but I guess it'll not be long until we hear of a attack targeting Neovim plugins.

And of course there's the learning curve. :Tutor helps to get started, but that's only the peak of a very large iceberg. You can get by very well with just the basics, but rabbit holes abound if you ever feel like pushing for more efficiency.

Not for everyone

Fiddling and setting up your own editor is not for everyone. In fact I believe most people find the desire befuddling, and I can't blame anyone for thinking this a giant waste of time. But for those with a spark for setting up a development environment that feels truly 'yours' or worried about ergonomics, I recommend giving Neovim a go. You might find yourself taken - hook, line and sink.

#nvim #tech