Effective Neovim: An Instant IDE [video]
youtube.com
youtube.com
I went deep and set up a neovim config, forcing myself to use neovim full time. However my new role requires me to use Intellij and I didn't want to spend hours upon hours figuring out how to replicate the java support in Neovim (and no, it isn't just installing the LSP, my work has some pretty specific intellij setup).
At this point I'm just using Intellij and VSCode with their respective vim plugins and I'm getting about 80% of the utility that I did with pure neovim. The one thing I really love about neovim is that it really forces you to keep your hands on the keyboard and you learn the keybinds very well because otherwise you just can't do the thing you wanted to! I find myself using the mouse a lot in VSCode and Intellij because they give you really handy buttons to click on.
I could probably go pure keyboard if I just sat down and learned all the various keybinds, but who has time for that?
Particularly, I’ve found the undo functionality to be far better with the neovim one, it never screws up. Holding alt and moving a line up and down can sometimes accidentally move your cursor one line higher or lower though.
Building a mental and muscle memory is tough but it requires grinding. You have to put in the time! It took me months!
My biggest mistake was starting and playing around with configurations and plugins for days/weeks and constantly having a broken environment!
Configuration hell is the worst path to get into neovim! Start with the starter kit but avoid going into installing 10s of plugins, custom key-mappings and themes until you have learned the fundamental of motions, navigations and editing.
Starter kit: https://github.com/nvim-lua/kickstart.nvim
Since someone inevitably mentions Helix on the *vim threads (and vice versa), I'll be that person today.
This is one of the things I think Helix gets right. It has the LSP, fuzzy finder, and a few other modern tablestakes features built-in, which makes it a joy to use. I spent a decade+ using (Neo)vim, and went from a few hundred lines of homegrown vimrc to maybe 6 or 7 lines of Helix config, for a few bits of muscle memory I couldn't shake.
It feels like the majority of Helix keybindings are the same as vim. Similar to how with vi-emulators, you'll bump into things you use that the emulator doesn't have; with Helix, you'll bump into keybindings you expect, which are different in Helix. https://gist.github.com/rgoulter/af83932a45c79f9f3fb673d8813...
The impression I get is that Helix's keybindings are well thought out. e.g. u/U for undo/redo vs vim's u/C-r. e.g. rather than Vim's H/M/L, Helix uses "go top"/"go centre"/"go bottom" (gt/gc/gb); and the bindings which jump the cursor around all use this `g` prefix.
Switching back and forth between Vim and Helix, there'll still be false-friends from time to time.
I still use vi mode for bash, and occasionally use Vim on systems without Helix. I definitely stumble a bit now, but it seems possible to retain muscle memory for both without much effort.
This is exactly my problem any time I try and get in to Vim/Emacs/NeoVim, even when trying some pre built config like Doom Emacs, LunarVim etc. Everybody has some bespoke setup so following along from a tutorial is a fucking nightmare because inevitably something will be out of date, or they'll be using a different package for say the file browser that makes it incompatible with the one you're using that you picked up from the previous tutorial. Or they'll be using a different package manager entirely, of which a new one seems to come out every year. Or you're fucking around trying to get LSP to work again because something has broke it. Or you'll try installing some kind of manager to let you switch between the different premade versions such as Doom Emacs and SpaceMacs and that won't work properly because Doom has been updated since it was written etc. It's just a never ending torrent of pain. It's the editor equivalent of the JavaScript ecosystem where there's some new shiny half baked bullshit every week. It's so much easier to just use VSCode or Jetbrains and have a consistent and reliable experience every time.
I do get that the Vim editing model is hard, but that professional developers refuse using a tool because you have to change some defaults and customize it a little is too much.
It's really not that hard or time consuming to setup, for more gains than many of the courses or experiences people have put themselves through.
And it's not like it's a "vscode vs Vim" thing, I see the same argument inside the Vim community too where people refuse plugins because it's too much work, or even switch to Vim-like editors that don't have a plugin system as if it was a positive thing.
What gives? I'm sure it's not as easy as everyone just being lazy.
Enthusiasts are familiar with a lot more, know the domain, and so are able to navigate the intricacies. -- There's an xkcd comic which points out that you're probably under-estimating what it takes to be familiar with this stuff. https://www.explainxkcd.com/wiki/index.php/2501:_Average_Fam... -- And while it's nice to be enthusiastic about stuff, not everyone's going to have full enthusiasm for everything they do.
In terms of accessibility:
Having "bad defaults out of the box" just doesn't make sense compared to "having good defaults out of the box". If it's very unusual, or unintuitive to use, that's just added friction to get someone to learn. (And if fewer people adopting a tool leads to a smaller community).
There's plenty of stuff which isn't so hard if you know where to look.. whereas, without knowing where to look, it's confusing to navigate.
There's a communal cost to having fragmented/bespoke setups; if everyone's using pretty much the same thing, then anyone can help anyone out. -- Someone familiar with the intricacies will be able to understand the differences, but a novice might not know which bespoke thing would be best to copy.
The xkcd hits home hard.
Maybe it's the perseption that it's hard and time consuming that's the problem?
Second, it's not fast and easy even with LazyVim, let's start with the basics like keymap:
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window", remap = true })
To understand this (and to adjust to your liking) you kind of have to learn the language you're not going to use ('gj' or <C-w>h) instead of using something easily readable like ["go","window","left"], or instead of actually pressing C-w to insert <C-w> like many (mostly GUI) apps allow
Then the time consuming part: it doesn't make it easy to resolve conlficts which inevitably arise when doing many rebinds. Also, it'd be very time consuming to learn and reference that unused binding language
Then the help is rather verbose and not intuitive (see my parent comment) (don't remember if help uses default keybinds or actual ones
Then it relies on a very barebones and not very popular language (though miles better than vimscript)
Then there are a gazillion of other things which make the perception reflect the reality pretty well
I know that sounds complex but if you're coding (which I assume many neovim users are) should be fairly straightforward
VSCode extensions can change crazy stuff such as [1], and are also more numerous. I don't see much of an advantage to terminal-vim apart from performance and perhaps an inherent joy of building your own tools.
[1] https://marketplace.visualstudio.com/items?itemName=hoovercj...
https://www.youtube.com/watch?v=QMVIJhC9Veg
The tl;dw is that the term 'PDE' means the tool requires some work in order to personalise, but because neovim exposes a robust API that work is fun and rewarding. Additionally, he makes the point that because you configure it in the same language as you script it with (lua), you have much greater control over how all the pieces fit together.
My only gripe is his requirement that the majority of users must make use of the scripting system in order for the program to be considered a PDE. If only 1% of all IntelliJ users ever use the Program Structure Interface or the powerful Live-Templating system, that's still a respectable number in total. And it also doesn't mean IntelliJ is less personalizable.
Maybe a better term would be a DIY-DE.
This is the kind of thing I would expect to see in emacs.
That said, I can't imagine ever wanting to have a website render in my own editor, that's the kind of thing I'd like to use my target browser for.
Also, most markdown ssg's have hot-reloading.
Helix isn't nearly as nice as my purpose-built Neovim setup, but it keeps working.
1. by using a serial image protocol
2. by drawing the picture in text