Ask HN: Is (n)vim worth the trouble?

24 points by loveparade ↗ HN
My main editor for the past few years has been vscode, but I've dabbled in emacs (Doom), neovimm and helix. I keep coming back to vscode due to the plugin ecosystem and ease of setup. But sometimes I watch long-term vim users writing code and I'm amazed at their efficiency.

But maintaining an up-to-date (n)vim setup seems like a huge time sink. In my experience, plugins are constantly deprecated and forked, or have breaking changes that need to be debugged. Part of this is just the open source dilemma.

For those of you who use vim as their primary editor, or have switched to/from vscode, do you believe all the extra effort required for vim is worth it?

54 comments

[ 2.9 ms ] story [ 121 ms ] thread
Yes, it's worth it. Unless you disagree, in which case it's not. I use neovim and vscode (and others) for different things or just because I feel like it.

> maintaining an up-to-date (n)vim setup seems like a huge time sink.

I find that updating plugins does often break things, which is why I don't update plugins (that are in a working state).

if your plugins are constantly getting deprecated, your setup is just too niche or bleeding edge. Use plugins with a large community already

I switch mostly between nvim and jetbrains products. nvim is my simple editor for adhoc stuff that I don't want to open an ide for.

I use vim and I don't think it's extra effort. My vimrc has changed once in the past 3 years. I keep trying vscode because I read about how much better the plugins are but I find with most I'm not really getting that much extra value.

I've tried switching to nvim too but I really like my vim setup so it never feels quite right.

If you can code in vscode and you like the interface than its probably not worth it.

Simply put: no. I realize that there are a lot of adherents who will judge me harshly for saying so, but that is the simple truth.
I only judge harshly because there's no absolute answer that applies to everyone. In your case perhaps learning vi/vim isn't worth the effort. For a significant number of other people the effort will pay off. You don't know. There's no "simple truth," just opinions and personal circumstances that change over time.
I don't judge you harshly, but I do pity you.
I'm not judging you for saying no, I'm judging you for not substantiating it. (Ex. "No, vim isn't so efficient that it justifies the learning curve", or " no, emacs is more customizable and vscode is easier")
For context, I'm saying it's not worth the trouble for the vast majority of people. Usage statistics agree with this.

https://survey.stackoverflow.co/2023/#section-most-popular-t...

https://news.ycombinator.com/item?id=30848456#:~:text=%3E%20...

And a good chunk of the 22.29%(vim)+11.88%(neovim) on that survey likely do not configure it out of the box (defaults) and are not using it as their sole/primary editor.

Outside of the stackoverflow sphere, (n)vim usage is far less (globally).

Aside from general usage scenarios, plugins and configuration is finicky and difficult most of the time. It requires care, maintenance and debugging to get things to work - and having to configure LSP/Tree sitter and other things can be frustrating. Things have gotten better, but OOBE leaves much to be desired.

The quality of plugins seem to be somewhat better on VSC (though for some of the more established plugins, (n)vim have really good ones - so it's about even here). It is a simple matter of searching for what you want in the Marketplace.

VSC gets me up and running in 15 minutes on a new machine, if necessary and provides enough working defaults that I can reasonably expect other people to be using the same thing. If not, it is a simple matter of creating a new profile (File>Preferences>Profiles>New) on someone else's machine - making my tweaks and I'm off to the races. I don't have to dive into someone else's config.

As far as being judged harshly, I am not surprised at the responses I have gotten - the fact of the matter is: you have to be a unique person to want to use (n)vim. Just by virtue of using (n)vim, emacs or similar style editors - you are already in the outlier of users that code/program on their computer. Just like being here on HN already puts you on the outlier. HN, Reddit, stackoverflow all exist in their own bubble of technically skewed, predominantly male in their 20s to 40s.

I use vscode with the neovim extension. I'm no vim aficionado (I still use the arrow keys...), but it's good to have the vi bindings in an IDE. It even supports variable width fonts!

And then when I open up (n)vim in a shell, the muscle memory carries over.

Im in a similar boat as you. My editing skills seem to plateau pretty early without any deliberate practice. And I always have something I'd rather do than sit down and deliberately practice editing.

I'm curious what people's thoughts are with a slightly reframed question: is explicit practice with your editor worth it?

While it would be nice to edit more efficiently, it's usually not a bottleneck to how fast I can create software.

I think 2-2.5 editors/IDEs is the limit. After that the costs of refamilliarization and updating/maintenance outweigh the benefits.
I used vi and then vim for years (decades) before VSCode came along. At the time I learned vi it was worth the effort, because the alternatives were terrible. For me learning vi/vim has paid off, but I learned it over time, out of necessity, with some deliberate practice.

If you can always use an IDE then do that and don't worry about vim or emacs. There's no actual club of greybeard CLI hackers who will not let you join if you can't h-j-k-l everything.

If you need to work directly on a server over ssh, especially a server you don't control, you will probably have to use a terminal-based editor. If vi/vim is too much use nano.

Our brains can learn multiple editors, multiple programming languages, multiple frameworks, etc. I never understand the questions that pose a false dichotomy: should I learn vim or VSCode? Python or Clojure? You can of course learn them all. And if you use something every day you will get better with it. If you take the time to practice you will get even better. Whether that investment of time and effort pays off eventually, hard to say, but knowing vi/vim well enough to edit code has paid off for me and a lot of other people, so I'd call it low risk/potential high reward. I also learned VSCode well enough to use it, so hedging my bets.

The main thing vim gives you isn't just editing efficiency and customizability. What it give is Zen- like focused state of mind when you don't need to use mouse.

That Free your mind from mental disruption of using mouse and clicking things and then put you in the zone for writing code, and then you can write code at speed of though, combined with a tiling window manager.

I've used vim, emacs w/evil mode, and currently use VSCode with vim plugin.

The editor itself doesn't really matter.

Learning mode based editing with vim key bindings absolutely is.

You get like 90% of the benefit that brings with any editor that has good support for vim style interaction.

I still regularly use nvim in my terminal for quick edits here and there, but do my development in VSCode and spend a lot less time managing a config/plugins/etc.

My one suggestion is to change your escape binding to something like 'kj' or an easily accessible two letter sequence that doesn't appear in English text. Your fingers will thank you for it (even if it makes using default setups on systems you don't control a bit disconcerting for 30 seconds).

I used to bind 'jk' to escape but it led to a few problems, in particular I would compulsively use jk as escape on remote systems I hadn't configured myself. In the end I realized I didn't mind ctrl-[ and have used that since.
I discovered that ctrl-c will go to normal mode, which is apparently rare but is an easy one-hand solution without moving your hand as far (and it doesn't need any config).
Keep in mind that there is a subtle difference between Ctrl-C and Ctrl-[. The latter is equivalent to Esc, but I think the former will for example prevent abbreviation expansion and block some plugins, which can lead to weird bugs if you’ve customized your Vim a bit.

I think you can however `inoremap <C-c> <esc>` locally to make it a bit safer, and just use the default Ctrl-C remotely (if your vimrc is not there then there’s probably no plugins or abbreviations to worry about).

Good point - IIRC it also breaks some uses of visual mode(?)
> change your escape binding

just use caps lock for esc. even the mac supports it.

Personally, I prefer caps lock for ctrl. I don’t really mind reaching for esc to switch modes (maybe I just got used to it?), but things like Ctrl-D, Ctrl-], and Ctrl-O in normal mode are quite unergonomic with the default position of Ctrl.
Why does your setup need to be always 'up to date'? I update mine periodically, usually when I update Arch and the nvim package updates. I might spend a few hours tweaking things then, but that's monthly or less. Sometimes I'll do it sooner if I'm actively tweaking nvim to my liking (for fun). I don't see it as a burden really. I like what Neovim provides me the other 99% of the time. If you like the batteries-included nature of VSCode, you could try an nvim distro (e.g. LunarVim), or just use VSCode. I can't use Neovim at work (sEcUriTy..), so I use VS Code. It's good enough, but I definitely don't enjoy using it like I enjoy using nvim in my terminal-based workflow.
I have used or had to use multiple IDEs at various points over my unix career but for the first 4 or 5 years I was all about emacs and for the last 20 years I’ve used vim. It’s been fantastic for me and it continues to be useful every single day.

Whether it’s “worth the trouble” for you really depends on you, what you value and what you do so it’s hard/impossible for anyone else to judge that for you. But if you’d asked 2000 me why I used vim I would have said because it’s great to be able to use the same editor for fixing config files over laggy remote ssh connections, or writing perl as for writing my email. If you’d asked 2005 me I would have said it’s great to be able to use the same editor for bash and python scripts as I use for massive Java and c++ codebases. If you’d asked 2011-ish me I would have said it’s cool that the editor I already know well supports these new languages I want to learn like haskell and scala, etc… Fast forward to yesterday and I spent 5 hours writing latex in vim and of course it works great.

So I guess what I’m driving at is this. You have no idea where life will take you and what you will end up doing but having this transferrable set of skills so you know whatever you’re trying to do with a computer you have a toolbox that you can apply to get a leg up on any new problem is very valuable.

The one real advantage of something like vim that is very hard for any normal IDE to replicate is that it could be part of that toolbox no matter what. You have to decide whether that’s valuable for you.

And you really don’t have to maintain any kind of up-to-date setup. I occasionally tinker because I like tinkering but the vast bulk of my vimrc I wrote in like 2002 or so and has remained unchanged. Every now and again I add a single line to add or remove a plugin, but it’s really not the be-all/end-all to make changes.

Oh and just to add, if you want something with a similar productivity and learning profile to vim but smaller footprint, no plugins and things like tree sitters etc working out of the box, https://helix-editor.com/ is worth checking out. It's similar-ish to vim with fewer inconsistencies in usage, less configuration possible/needed and my experiences of using it so far have been pretty great. There are a few vim features that I don't really know how to live without but tried using it exclusively for a few days and was very impressed in general.
I've tried Helix for 3-weeks. The micro for half a week. I'm back to joe, nano, geanny, vscode,

It's 2023. Our keyboards are standardized (looking at you, Chromebooks) with control, alt, altgr, meta keys.

I can't understand why micro is the only console/cli editor that (partially) supports 1987's CUA standard[1]. All I want is TUI text editor or IDE that let me use Shift-Arrows to select text, Home/End keys should do what their names say, but if you hold Ctrl, they go to the beginning and end of file. I'd like to use use Ctrl-Ins/Ctrl-Del/Shift-Ins/ to access the Clipboard. Can we also have some menu or palette system, perhaps context-sensitive that includes every mapped shortcut? How about an easy system to create some windows or panes that can. E easily moved and resized? Wouldn't it be terrific if I pressed momentarily say, control-alt, and a calculator, calendar or a terminal showed up?

MS-DOS edit.com, Borland SideKick and Turbo IDEs had all these em 1991. I'm very fond of Midnight Commander editor, micro, joe, nano exactly because they have this DOS atmosphere, where the learning curve looked more gentle.

Linux and other unices got into a very interesting scenario. If the application is intended to run over a graphical desktop environment, it'll likely follow the CUA specs. OTOH, console/cli tools decided they don't care about CUA or current UI/UX practices (notable exception is micro), they will keep using standards created 40+ years ago, ignoring the standardization we've adopted since PC GUI massification around 1990.

[1] https://en.wikipedia.org/wiki/IBM_Common_User_Access

I've been using vim (now neovim) for almost 20 years now.

In terms of efficiency/productivity/time saved, my guess is that it's not worth it.

In terms of happiness, I love it. I live in vim+tmux+bash. My setup is extremely personalized. If anything annoys me about my day-to-day activities, I can just change it. It can be a time sink, but I enjoy it.

> In terms of efficiency/productivity/time saved, my guess is that it's not worth it.

For me, I wouldn’t be using vim if there wasn’t a productivity bump. When I became comfortable with vim I was appreciably faster, but it took maybe a year to get to that point. Not having to reach for the mouse is a huge benefit. Macros turn repetitive manipulations to a from O(n) to O(1). Using the dot key to repeat a change can be very powerful too

(comment deleted)
>In terms of happiness, I love it.

In terms of happiness, I agree. Productivity is not bad too (understatement of the year :). But as for any powerful tool, to get the most or even a lot from it, you have to spend some time. But IMO at least, the learning curve is shallow, for easy to medium tasks.

And anyone not knowing the basics of vi, can get started very quickly with my vi quickstart tutorial below.

I had first written it at the request of two Windows sysadmin friends of mine, in a company where we were working at the time.

They had been given additional charge of two Unix boxes, so, being busy people, as sysadmins usually are, they asked me to write a tutorial that would let them hit the ground running for common sysadmin text editing tasks. After reading it and using Unix for a few days, they told me that it was useful and met their need.

The tutorial is small, so it can be read soon and you can start applying it right away:

https://vasudevram.gumroad.com/l/vi_quick

It enables you to start with just some basic vi commands, and as you go, you can build more vim-fu by reading the docs, blogs, videos, practicing, etc.

Also be sure to check out this famous StackOverflow answer to grok the zen of vi:

"Your problem with Vim is that you don't grok vi.":

https://stackoverflow.com/questions/1218390/what-is-your-mos...

I think it is completely worth it to learn the Vim editing commands. You can get a lot of the benefits from just turning on Vim-mode in VSCode or IntelliJ. Emacs with Evil mode is an improvement in my opinion as well. The quick line editing, moving around the file, etc etc smooth out your programming experience a lot.

If you're working a lot with text, Vim macros are great. I'll regularly go into Vim as kind of a text workbench.

If you want to try an auto-updating Vim suite, check out LazyVim [0]. The defaults are great, and there's a lot of features with absolutely zero configuration.

[0] https://www.lazyvim.org/

Learning vim shortcuts is worth it. Or the eMacs ones. Pick your poison. The eMacs ones are a bit more common in more applications but I personally have more muscle memory with vim.

Neovim was introduced about the same time than vscode but I prefer vscode with a vim plugin. Before vscode and neovim I had many weird setups. The weirdest I used for a while was perhaps eclim, that is vim and eclipse together, but vim as the user interface. http://eclim.org/

> The eMacs ones are a bit more common in more applications

I think it depends on your platform? On macOS, nearly all apps support a (very small) subset of Emacs keybindings. On all platforms, Readline and friends default to Emacs keybindings (but do support Vi).

On the other hand, many classic UNIX utilities - for instance `less` - also implement Vi-like keybindings for navigation and search. There’s lots of third-party TUI applications that copied some keybindings from Vim. Many GUI applications (e.g. Sublime, VSCode, Firefox, Chrome, Google Docs, Obsidian, …) have support for Vim keybindings either as a popular plugin or bundled.

My guess would be that more apps support Vim keybindings than Emacs keybindings, simply because Emacs users would prefer to implement their needs (email, notes, …) inside Emacs instead of going to a third-party app. But I don’t have statistics to back that up, just subjective observations :)

vim bindings are worth learning, vim/nvim itself is not. Two reasons. One, graphical debugging. Almost every hardcore vim/nvim user I've met has terminal (no pun intended) printf-debugging disease, or uses an IDE on a second monitor. Carmack talked about it in an interview (https://youtu.be/tzr7hRXcwkw)

Secondly people, especially with neovim, seem to be hellbent on turning the thing into a GUI editor anyway, with bespoke search interfaces, file tree plugins, graphical plugin installers, and so on. At which point I don't understand why you're not using something made for that purpose rather than painfully try to reinvent it in a piece of software designed to output text

If it's a "trouble", then no, it is not "worth it". Use whatever works for you.
nvim is worth the investment if your answer to any of the following questions is yes:

1. Do you work on really large codebases every day?

2. Do you type as fast as you can think and frequently need to wait for the UI to catch up with what you just typed?

3. Do you have a large codebase sitting on a remote computer?

4. Do you have to ssh into random computers or embedded devices and quickly edit or modify something inside?

For me, the answer to all 4 questions is yes, I’ve been using neovim and vim before that for most of my career. I can strongly recommend it.

> But maintaining an up-to-date (n)vim setup seems like a huge time sink. In my experience, plugins are constantly deprecated and forked, or have breaking changes that need to be debugged. Part of this is just the open source dilemma.

You either have too many plugins, or are in a part of the ecosystem where vscode is probably a safer bet right now (still maturing). My vimrc, including the few plugins I use, has barely changed in years (seriously, last commit 2021, last before that 2020).

Edit: Actually I have 10 plugins, so not as few as I thought. Stable ones, though.

> But maintaining an up-to-date (n)vim setup seems like a huge time sink. In my experience, plugins are constantly deprecated and forked, or have breaking changes that need to be debugged.

I think it's worth putting the effort in to learning core vim functionality. Once you do then you find that you don't need some of those plugins that you're having trouble with.

These days I run with a pretty light .vimrc and no plugins.

Consider using vim for side tasks to augment your main VS Code use, and maybe you'll make some useful discoveries while gradually getting use to it, instead of going all-in.
Absolutely. As others have mentioned in this thread, by far the largest benefit to effort ratio is from learning the vanilla keybindings and becoming fluent in them. All the custom key maps, plugins, and settings come later.

If I were you I would start by enabling vim mode in vscode and practicing there. You get autocomplete by default and a familiar environment and can just focus on gaining keybinding proficiency. Then, as you get more experienced the new shortcuts you will want to define will come naturally.

I switched to Neovim because of RSI. I don't think I would have been able to keep my job without it. I know the other editors have Vim emulation plug-ins, but I found I would always reach for the mouse if I didn't know the keystroke(s).

There are definitely moments that result in a bit of time sinking. Overall the tradeoffs work out for me.

I've used vim for about a decade now and learned about it in college from friends. Having vi available on nearly any box makes it very universal.

Most modern IDEs have a straightforward enough vim plugin that just works in my experience (at least the JetBrains ones do).