Live data from Hacker News

Don't use Vim for the wrong reasons (2020)

gist.github.com

21–30 of 85 posts

Re: Don't use Vim for the wrong reasons (2020)

#21

Counterpoint (or at least counter-consideration): Sometimes Vim is really, truly, absolutely the very best tool for the job and very much worth your time. I learned Vim because I had to edit code through an ssh tunnel, limited to text only, and nano just wasn't cutting it any more. This is pretty much the exact thing vim was born to do, so it was a pretty clear win to learn Vim, despite the horrifying learning curve.…

Well there are a lot of text-only editors better than nano. Emacs of course is the big one, but there are probably a half-dozen others with varying amounts of featuers. Unless you also meant "installed by default" then vi[m] is probably about it.

Re: Don't use Vim for the wrong reasons (2020)

#22

What is the consensus on productivity with Vim? I have thought about trying out the keyboard only approach, but haven't wanted to invest time in it yet. When I see people on YouTube using Vim it slightly feels like there's a whole lot of keypresses happening, but not a lot is actually gained compared to using a mouse or even frequently it seems it takes a while to do something that is much quicker with the mouse. I u…

The difference in productivity is hard to measure. What's really gained by vim bindings is not having to leave flow state to move the cursor over there and then change that word for a different one. The same operating can be done with a cursor, but in having to leave home row and then come back to it, your mind has a chance to wander and you start thinking about whatever else is going on in life. Like why you're using a mouse and not vim keybindings.

Re: Don't use Vim for the wrong reasons (2020)

#24

> if you think it's everywhere One of the counterpoint is vim not being available on Windows. But It is. Not by default, but most critical stuff aren't there by default anyway and vim will be one of the easiest block to have ready. Then Windows comes with WSL, where I think most people who even care in passing about vim will spend their time, so we're back to the editor they'd use on Linux anyway. That was to me the…

At the time of writing, the supposed ubiquity of Vim, or rather Vi-clones, was often touted as a strong selling point by people with a severe case of Linux-myopia.

The "counterpoint" is not that Vim is not _available_ on Windows. It is that Vim is not on Windows _out of the box_. You must install the native binary to have it or, like you suggest, install _another system_ on your machine… that actually comes with Vim.

"Can have X" is not the same as "has X".

FWIW, experimenting with Linux is also what got me hooked to Vim (and the shell and all the rest) in the first place, but rose-tinted glasses are not for me.

Re: Don't use Vim for the wrong reasons (2020)

#25
post #7

One of my favorite things about using vim as my main IDE is, I can run it on a linux server. My work has me moving around the country. I program on a vim instance running on a remote server. I just need to carry a tiny laptop around. I usually get an okay ping( edit- Incase anyone is wondering, I actually started doing this since one of my laptops once got lost while traveling. Airline did find mybag later, but the t…

Does that have any advantage over VSCode Remote SSH?

Re: Don't use Vim for the wrong reasons (2020)

#26
Regarding using the right tool for the job:

> sed, awk, cut, a quick bash one-liner, a simpler editor, an infinitely more powerful IDE, an actual IRC or mail client, an actual presentation program, some online CSV-to-JSON converter, etc.

All of these will take time to learn or find. I know basic sed syntax but I'm never 100% sure that my edit does exactly what I want, so I end up running without -i and then with. I don't know awk at all. I use cut but always mess up the field numbers, and if there's multiple spaces involved then forget it. In all of these cases, it's faster for me to open the file in vim, make the change or grab the word I need, then exit. I'm not saying the tools are useless, but vim is flexible and covers a lot of use cases.

Half these examples are gui programs. Who is realistically trying to replace a presentation program with vim? These seem like strawmen to pad out the list.

Is vim the right tool for every job? No, definitely not. But I think it does well enough that it's okay to lean on it if you already know it.

Re: Don't use Vim for the wrong reasons (2020)

#27
I set up F2 to run the shell command on a line in nvim, and I noticed it improved my shell productivity. I run tests with with cargo test, rspec, pytest etc by writing the command on a line, hitting F2 and all results are just there. I can navigate to errors, search traces or whatnot all the same as I navigate the code. I can search GitHub issues when I'm writing a commit message with gh. This is just a simple productivity hack that I can't replicate in other editors.

I'm sure there are better special tools but vim is the most general purpose tool you can learn and use. I never had regrets to invest time on it.

Re: Don't use Vim for the wrong reasons (2020)

#28
post #19

sketchy terminal integration Vim’s :terminal is better than win10 terminal. And than Konsole too, for that matter. (Maybe I mistaken “integration” for something else.) to being single-threaded Is this a problem? All language servers run async in different processes. I don’t think vscode is multi-threaded either. Multi-processed sure. Threads are mostly dead. I’m not a vim missionary, don’t use it, don’t learn it, don…

> Maybe I mistaken “integration” for something else.

Yes, you do. This is about how Vim integrates with the host terminal emulator and shell.

Re: Don't use Vim for the wrong reasons (2020)

#29
I made the mistake of using vim before switching to an IDE. I bought in to all the tough guy talk and put tons of effort into learning the arcane key combinations and trying and failing to get plugins to work to make it do basic programming stuff. Utterly pointless - use an IDE - if you are a professional programmer it is the one tool you use all day every day, spend the money for the best one you can that has a team of people working on it full time, paid well to make that IDE awesome.

I use vim all the time now for simple text editing when logged in to a machine but I'd never dream of using it for programming. I know how to cut and paste lines in vim and how to save and exit, nothing more needed.

Re: Don't use Vim for the wrong reasons (2020)

#30

What is the consensus on productivity with Vim? I have thought about trying out the keyboard only approach, but haven't wanted to invest time in it yet. When I see people on YouTube using Vim it slightly feels like there's a whole lot of keypresses happening, but not a lot is actually gained compared to using a mouse or even frequently it seems it takes a while to do something that is much quicker with the mouse. I u…

There is no objective evidence that Vim makes you a more productive programmer. There is no evidence that avoiding a mouse makes you a more productive programmer. Use the editor you want! Vim is faster at some things and slower at some things.

The main drawback of all the keypresses you see is that Vim is an imperative editor: You have to tell Vim how to edit text by glueing together lots of small commands.* IDEs are declarative editors, you say "rename this variable" and they do it.

* Ask your local Vim nerd to rename the file they're editing. It will be entertaining!

Post reply on HN