Hacker News new | past | comments | ask | show | jobs | submit login

Please just read Practical Vim if you’re going to double down on using Vim. All of these tutorials are the minimal basics. Vim forces you to glue together lots of inefficient commands to manipulate text. I feel frustrated seeing Vim users tout how efficient their editor is when they haven’t learned all of Vim’s nasty bells and whistles you need to actually be efficient at manipulating text. (When you press colon, do you know how to edit the command in Vim mode? No? Read Practical Vim).

I can't really understand whether you recommend Vim itself or not, because of these sentences:

> Vim forces you to glue together lots of inefficient commands to manipulate text

> Vim’s nasty bells and whistles you need to actually be efficient at manipulating text

I’m a power Vim user. I do not recommend it for code editing. Learn it as a curiosity if you want. It’s also handy for quickly editing over SSH. IDEs with multiple cursors are so much nicer than Vim.

This is odd to hear because the general consensus online is that vim/vim motions makes for seamless text editing.

I also feel like multiple cursors is an antipattern, you don't need multiple cursors in vim. You need a macro, which is easy to make and you can pass this to a buffer to modify it or apply it to certain lines or the entire file.

Personally I love Vim’s visual block editing and use it a lot too.

Macros are more flexible but visual block works well in a lot of situations.

Either way if one was really tied to multiple cursors Vim and NeoVim of course have plugins that support it. I don’t bother with them myself.

> I don't bother with them myself

This makes senses, because these plugins are terrible (I've tried them), and if you had used them you wouldn't suggest them as an option.

Vim macros are OK, and better than multiple cursors in the minority of situations.

If you record a long macro, and you make a typo in the middle, do you know how to edit that typo in the middle of the macro? You probably don't*

The answer is you past the macro contents into the buffer, edit it, then yank it back into the macro register. Do you know how to properly yank this so characters are escaped properly and you don't copy the line break and put it in the right buffer? You probably don't*

Do you know how to make this processes easy to iterate on so you can trial and test macro changes each time you modify the buffer? You probably don't*

* This isn't meant to be a dig at you, it's based on my experience with other Vim users. If you know how to do all of this, shame on me.

Most Vim users I see manually go back and try to re-record the whole thing, or don't know how to use macros in such depth.

Either way, none of this matters. These are Vim problems only. Multiple cursors are so much nicer, partially because they give you instant feedback, and trivial undo. The only thing I've missed from macros is manipulating numbers, and VSCode plugins that increment in multiple cursors solve 90% of that want anyway. It's so nice not to have editor problems (aka "how do I edit this text in Vim"?) and instead just use the editor seamlessly.

> This isn't meant to be a dig at you,

That is, of course, how it comes across, although a fairly mild one. If it's not meant as a dig then I would suggest generalising the phrasing to something like "many people" so that it's not direct at me.

As it happens I do know how to copy and edit registers. It's actually something I rarely need though because I can do most multi-line edits using just Vim's visual blocks. That's out of the box with no plugins.

I only mention multi-cursor plugins because they illustrate that Vim/NeoVim can and will be taught to every new trick over time, which is one of the nice things about an actually open source editor.

cool, that's a really useful opinion!

Perhaps I'll stick with VS Code over SSH, then

There's no reason to be snarky.

Wasn't being snarky.

Applications are open for YC Winter 2024

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact