Live data from Hacker News

Ask HN: Is Vim still worth learning?

news.ycombinator.com

41–50 of 93 posts

Re: Ask HN: Is Vim still worth learning?

#41
My workflow for years has been using vscode for editing code only and completely ignoring most of its plugins and other features.

The work-issued machine may run windows or macos, but my dev environment always matches the testing/production environment and that's linux (usually ubuntu).

I always have several terminals open for git, docker, tailing logs, watch scripts, etc. Vim is really the only sensible option for editing configuration, writing git commit messages, _viewing logs_ ... can't stress that last one enough. What are you going to do when you need to do more than just grep a single log file? You need an editor that doesn't blow up opening massive files.

Yes it's absolutely worth knowing. Everyone who uses it needs it and everyone who doesn't eventually will.

Re: Ask HN: Is Vim still worth learning?

#42
post #29

Earlier quoted context omitted.

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

> GUI tools often tie you to a specific workstation setup. VS Code and Android Studio can run on all major desktop operating systems, and more cross-platform IDEs are coming out. > VIM is already installed everywhere you need it and does not require you to have a workstation with a GUI The chances of you having a workstation without a GUI over the past 30 years has been pretty small unless you're a sysadmin.

> The chances of you having a workstation without a GUI over the past 30 years has been pretty small unless you're a sysadmin.

I spend a lot of time in the terminal and in vim (13 terminals open at the moment)

I don't think I've used vim on a guiless terminal for a decade. The only thing I'm on a physical server for is for installing on bare metal with no ilo - which means a 640x480 text installer, USB stick, and a keyboard to type in the IP and gateway (although Ubuntu has broken that as of this year). Once that's done the install is automatic, and then I can ssh into it a few minutes later.

10 years ago maybe I used the terminal to edit things like /etc/network/interfaces to change network settings once in a blue moon. That's hardly a full featured use of vim though.

However I do ssh into servers and edit files on those servers, and vim is on every server I connect to. I believe vscode will work transparently to do that though, editing over the ssh connection.

Re: Ask HN: Is Vim still worth learning?

#43
> I'm somewhat experienced using linux and the terminal, and would be curious to dig deeper into more terminal-based workflows.

Then yes. Learn Vim because you're interested and because it makes text editing fun. If you don't enjoy it, stop. In the worst case, you've still learned the basics of a useful skill.

Re: Ask HN: Is Vim still worth learning?

#44
post #36
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…

> things like S to replace the line what is this barbaric default binding, s/S shall be bound to the indispensable vim-surround! ;) built in text objects are already nice combined with modifiers (e.g cw, ciw, caw, cW, ciW, caW), ramping it up a little bit with argument (ca, cia, daa), surround (cs"', cs([, ci", ca", viWS , dst), and indent (vii>) is stupidly powerful. Once the [verb][modifier]{object} pattern clicked…

Most people I know (including many linux users) regard me as a vim pro relative to them, and I still have barely an idea what most of these do. Or what surround is. Might want to explain a little for the rest of us mortals ;)

Re: Ask HN: Is Vim still worth learning?

#45
Yes; 100% yes. I'll make three pitches here:

1. Vim has almost certainly staved off RSI for me. I've probably got > 10k hours physically programming under my belt. From time to time I've felt small pangs, but my worst RSI has been when I was using a mouse. Vim will also let you remap whatever you want, so you can adapt it to whatever your changing physicality is.

(Side note: I know a lot of people talk about their muscle memory, but even I as a person who can't always tell you how to do what they do in Vim have adapted here and there; most recently: Neovim changes what 'Y' does, which is ABOMINABLE DO YOU HEAR ME NEOVIM DEVS I CURSE YOU--but I adapted in like a week)

2. You can adapt Vim to help you think, and get out of you way when you're on a roll. This is more important than you might think. Vim will help you avoid blunders by letting you use whatever combination of linters and checkers you want. Vim will also let you edit code so fluently that it's close to the speed of thought.

3. Vim is open source. Not everyone is as Marxist as I am, so I recognize that this might not resonate with everyone. But as SWEs, SREs, etc., our major community is the open source community. This is our garden, our house. We should be building, using, and improving our own tools. A world in which all our tools are corporate built and owned, and used solely for the purpose of doing their bidding sounds pretty bleak. It sounds like every house is a McMansion leased from Zillow and decorated from AirBnB-approved home furnishing warehouses delivered by Uber Eats. I know that's pretty far down the road from just using VS Code, but when you think about the corporate strategy behind it, what else could it be?

Re: Ask HN: Is Vim still worth learning?

#46
No, just the basics is enough, and has been enough for me for almost 30 years. The move to containerised services has reduced the need to SSH to servers for the most part.

Personally I've enjoyed using Emacs more. With a good setup I have been more productive with that tools than I would have been with Vim.

Re: Ask HN: Is Vim still worth learning?

#47
Vim is basically the only editor you can safely assume to be available on any machine you’ll ever interact with. In my opinion, this fact makes it a requirement for virtually any developer to be able to confidently use vim during a production incident to, say, fix a broken config file while being connected to the machine through (multiple hops of) SSH, without any ability to use your editor of choice.

Once this basic-but-crucial skill level is mastered, using vim more proficientely as a daily driver is entirely a matter of taste. Personally I prefer using a fully-fledged IDE for anything that goes beyond a simple script.

Re: Ask HN: Is Vim still worth learning?

#48
Not sure why there's a `still` in the question. As long as there's text files to edit there will be a good reason to learn Vi(m) or any other console/text/GUI editor.

Here are some reasons why I use it:

- it's fast

- works consistently well over SSH/in docker containers/remote

- can use it pretty much everywhere and if it's not installed it's easy to setup

- awesome for doing quick text edits or text manipulation (I prefer Vim to sed/awk or anything else)

I don't Vim as an IDE replacement since I find it just takes too much time to maintain a working setup. I'm also not a fan of addons/plugins as over time they tend to fall apart.

Re: Ask HN: Is Vim still worth learning?

#49
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…

I don't think that's true. There are precious few UI guidelines that persist, and GUI design has been on the forefront of many fads. Looking at the touch-first UI of today, I have very little confidence that a GUI will look anything like it does now in 10 years.

Meanwhile, I can use vim over ssh from an iPad if I need to - my tools have come with me.

Re: Ask HN: Is Vim still worth learning?

#50
Some strengths:

1. vi is ubiquitous. So if you're even in a situation where you SSH into another machine, knowing how to use the basics of vi is valuable.

2. vim's modal editing is very expressively powerful. That's why vi-emulation (or now embedding) plugins are so popular. -- Yes, it's worth learning enough of vim's motions here. (My favourite example is e.g. `printf("hello| world");`, you can type 'change text inside `"`' using the sequence `ci"`).

Post reply on HN