Live data from Hacker News

Ask HN: Is Vim still worth learning?

news.ycombinator.com

21–30 of 93 posts

Re: Ask HN: Is Vim still worth learning?

#21
Vim is fast, in performance and in productivity. Every key has a purpose, which you can define it to whatever you want, and create your own macros.

Everything is a shortcut, which makes it very easy to navigate, replace and much more. For example, replacing is very easy in vim: you can use substitution, r key, while in other IDEs you need to go to a menu or press on some button or other but not as easy in vim. For me navigation in vim changes my productivity, in terms of getting to EOF, end of line or other. This is my personal opinion, but you might feel more comfortable with a normal IDE.

Also note that learning vim can take some time and patience is a must.

Re: Ask HN: Is Vim still worth learning?

#22
> [I] found the "hjkl" navigation difficult

That's because you're doing it wrong! Hjkl are fallbacks to move a few characters, it has only a minor advantage over arrow keys are is probably not worth the effort of re-learning how to move a cursor.

I would not recommend learning that as your first vim move. Just stick to cursors for moving individual characters at first.

The real magic is in going back/forward words (b/w/e) without needing to reach for control at the edge of your keyboard, jumping to an exact point you need (f/F/t/T) if it has a unique character (like the ')' within 'if (uid == 0)'), moving between paragraphs ({/}), going to matching parens/braces/brackets (%), going to the next/previous word under the cursor (*/#), etc. This is what will make you faster, not the switching from arrows to hjkl.

And that's just cursor moving. For editing, things like S to replace the line or C to replace the rest of the line after the cursor, di) to cut the part within parentheses and p (paste) it elsewhere, repeating the previous action with dot, searching with n/N instead of a function key, all those things are what makes vim nicer as a text editor. One of the least-appreciated things that I also use a lot is filename completion with ctrl+xf (sysadmins, take note!).

But I don't recommend learning everything at once. If you know how to go into insert mode (i), how to leave insert mode (escape), and how to save a file, then you basically have the equivalent of a text editor, especially with mouse mode enabled (the default nowadays, I think). From there, learn one command every week. Takes 1 minute per week and you'll know more vim than 99% of developers within a year.

Or go a bit faster and try to learn one command every morning, or every second day perhaps. Try it for one month and see if you want to go back to standard editors. Odds are, you'll want the best of both worlds, start looking for vim key binding plugins in IDEs, and end up like me with missing vim after all because those keybind plugins are usually not so great ^^'

> mostly using Java IDEs, and lately some vscode (for go, typescript, rust)

Do you need intelligent autocompletion, debugging, and other such IDE features?

There are plugins that, so far as I know, can do a lot of what an IDE can do, but I have never bothered to set them up myself. It all seems hacky and niche, but others can tell you more if this is the type of things you're looking for. I am not a real developer myself but I write a lot of scripts (things small enough to keep a full understanding in my head) as well as documents (reports for pentests) in vim, and for that it is perfect.

Re: Ask HN: Is Vim still worth learning?

#24
Worth it? Absolutely, without a doubt. Should you? Only if you find it fun, especially if you prefer the keyboard to the mouse, although you can definitely use the mouse in vim too.

I would go with neovim over vim nowadays, and if you want something more familiar that will get you up and running more quickly, try AstroNvim [0]. Later on, if you also like to tinker, you can set it all up just the way you like it.

I've heard of vim being called a PDE (personalized DE) [1], and I think that makes a lot of sense.

[0]: https://astronvim.github.io/

[1]: https://www.youtube.com/watch?v=QMVIJhC9Veg

Re: Ask HN: Is Vim still worth learning?

#25
I've always found it curious that Vim is most often associated with modal editing. I consider it to be so much more than that; highly customisable, huge plugin ecosystem, ubiquitous, lightweight and works in the terminal.

Modal editing never stuck with me, I just ended up writing more and more conventional shortcuts, so much so that I wrote my own "No Vim" mode plugin [1]. Just like VSCode and other editors have "Vim mode", so too does Vim have a "conventional mode".

So don't let modal editing be a factor in your considerations.

1. https://github.com/tombh/novim-mode

Re: Ask HN: Is Vim still worth learning?

#27
Vi was designed for very slow connections, maybe 300 symbols per second. As such it needed to minimize the keys needed to accomplish a task and maximize user friendliness within such constraints. Turns out that goal is still very much relevant today - although there is a learning process to learn the code book.

Re: Ask HN: Is Vim still worth learning?

#28
post #22

> [I] found the "hjkl" navigation difficult That's because you're doing it wrong! Hjkl are fallbacks to move a few characters, it has only a minor advantage over arrow keys are is probably not worth the effort of re-learning how to move a cursor. I would not recommend learning that as your first vim move. Just stick to cursors for moving individual characters at first. The real magic is in going back/forward words (b…

> There are plugins that, so far as I know, can do a lot of what an IDE can do

I want to add that the converse is true too: there are a lot of plugins (for IDEs) that do a lot of what Vim can do. I personally use the neovim integration for VSCode and it's really nice.

Re: Ask HN: Is Vim still worth learning?

#29
post #15

Yes definitely. Vim will be around for the rest of your career, long after VSCode or other IDE's have come and gone. Investing in tools and workflows that are properly open source, and have serious longevity has a big payoff.

Maybe... but OTOH, the IDEs that come after VSCode will still follow the UI guidelines that have been established for GUI tools during the last ~40 years, e.g. having menus where you can find out which functions are available, and then memorize the shortcuts for the functions you use most often, rather than having to learn everything "up front" before being able to become productive. I suspect one reason for the long…

OTOOH, GUI tools often tie you to a specific workstation setup.

VIM is already installed everywhere you need it and does not require you to have a workstation with a GUI

Post reply on HN