Live data from Hacker News

Vim Anti-Patterns That Cause Beginners To:Quit

paweldu.dev

41–50 of 135 posts

Re: Vim Anti-Patterns That Cause Beginners To:Quit

#41

Earlier quoted context omitted.

The great thing about vi(m) is that it's always there . SSH'd into some random server and need to edit some random config? vim. And Sublime is vim with a user-friendly-ish GUI wrapped around it.

>The great thing about vi(m) is that it's always there. SSH'd into some random server and need to edit some random config? vim I hate that, I ssh in, then maybe I want to edit cron and I am hit with vim(someone changed the simple nano with it), in the past you had no choice then google how to quit vim but now it will tell you how to do it(I ssh and change config files 1 or 2 times a year). I never learned how to quit…

A lot of times it's easier to just learn the tools of the trade instead of fighting a never-ending battle. I don't need or like awk, but I learned it because it's in use and it was very helpful to do so.

Re: Vim Anti-Patterns That Cause Beginners To:Quit

#42
I used to spend a lot of time messing with Vim configs, memorised enough shortcuts to save me time, and set them up in my dotfile repo. I have since switched to VS Code permanently and I would not look back. It just works with so many toolchains/workflows, and as much as I dislike electron, it is in my estimation, no less productive than my Vim-zealot setup. The command palette is good enough to navigate functionality for me.

It is my personal opinion that there is no good reason to learn Vim or its variants nowadays with the current tooling available. We should be trying to innovate on something better than text editing for producing code because there has been next to _zero_ innovation (imo) in paradigms for producing code for literal decades and I know there is an opportunity for something better. I don't know what that kind of 'better' would look like but I'd be really interested to find out.

Re: Vim Anti-Patterns That Cause Beginners To:Quit

#43

I just don't buy the premise that I will profit from spending a lot of time optimally customizing a text editor to my supposedly very unique and special needs. Seems more like a weird para-work hobby than an actual productivity hack.

Check out micro[1], there's no need to learn key shortcuts because it uses the same ones that every IDE or text editor ever uses. It also has full mouse support.

[1] https://micro-editor.github.io/

Re: Vim Anti-Patterns That Cause Beginners To:Quit

#44
probably the single most useful thing in NeoVim is

:set inccommand=nosplit

This lets you see the results of commands (like complex regex for example) while you type them. For me this has made a huge difference to the enjoyment of refactoring code. It is both possible and fun to try a ridiculous regular expression with lots of capture groups or even one that works across newlines when I can watch the results as I type.

Saddly this only works in NeoVim to my knowledge, not in regular vim, but it's pretty amazing.

Re: Vim Anti-Patterns That Cause Beginners To:Quit

#45

Earlier quoted context omitted.

>The great thing about vi(m) is that it's always there. SSH'd into some random server and need to edit some random config? vim I hate that, I ssh in, then maybe I want to edit cron and I am hit with vim(someone changed the simple nano with it), in the past you had no choice then google how to quit vim but now it will tell you how to do it(I ssh and change config files 1 or 2 times a year). I never learned how to quit…

A lot of times it's easier to just learn the tools of the trade instead of fighting a never-ending battle. I don't need or like awk, but I learned it because it's in use and it was very helpful to do so.

This leads to being stuck with tools which are unpleasant to use and sometimes not suited for what you want to do with them - for example, editing text files as a beginner.

Would it be better if Nginx would have never been written and we'd all use Apache instead?

What about Docker never having been written and us having to ship VM images with no tool chain around them?

What about JetBrains never creating new IDEs and everyone being stuck with Eclipse or NetBeans?

What about no systemd and having to use sysvinit or OpenRC? Okay, perhaps that last one is debatable, due to some valid concerns.

If Vim is so powerful, then this power should be embraced and transformed into a software package that's easier to use, be it with nano style hints or simpler shortcuts - Vim isn't good because of its accidental complexity after all!

Of course, that might take a few generations, because no one who knows Vim wants to relearn it, whereas the newer people will oftentimes simply resist using it.

But my point is that the weaknesses of each software package should be addressed and eventually fixed, either in itself or another to replace it.

Re: Vim Anti-Patterns That Cause Beginners To:Quit

#46
post #11

Earlier quoted context omitted.

> Eventually you'll come across a particular use case where opening a full blown IDE doesn't feel worth the effort, so you'll open vim. Imho there are strictly better options than vim for this nowadays for people who are not already invested in vim. Sublime text is easier for people that prefer GUIs. For CLI, Kakoune has better discoverability, better thought/more consistent commands, and actually usable colorschemes…

Yeah. It's pretty easy to delete a line in Sublime, and contrary to CLI fan wisdom, a single accurate trackpad gesture is simpler and faster than the barrage of commands needed to jump to a particular line. The studies that "prove" CLIs are faster than GUIs are decades old now, and my experience says they're obsolete.

I think there is merit to learning vim, and merit to using a GUI/IDE. Especially if you can combine both. Submlime, vscode etc all have reasonable vim bindings.

I was an avid user of vim for many many years, and I would not describe myself as a vim expert, rather I know a lot of the core commands. I have since switched do vscode (for many reasons) and still use the vim bindings.

I also don't believe it is just an issue about speed using the mouse. I believe it's also a movement issue.

This is the benefit I get, if it is vim/vscode/jetbrains etc as long as it has vim bindings I know `dd` is going to delete a line etc, the editing experience is fairly static. Block editing and yanking, F, T, ctrl-D, ctrl-U, cw, de, cs"`, vwS(, ci", and many others are all great vim methodologies, just like cmd-p (mac) for sublime and vscode.

Multicursor in vscode, feels broken do to me compared to block editing but even if I need to do mutlicursor across distributed lines (something missing from vim) I can use `gd`.

I would say vim is more of a methodology than just an editor.

Re: Vim Anti-Patterns That Cause Beginners To:Quit

#48
post #34

Earlier quoted context omitted.

People say things like this, as if other text editors don't have the same functions. The alternative is not "notepad.exe", it's Textpad, VS Code, or IntelliJ IDEA. Delete an entire line: CTRL-Shift-K in VS Code. Or just look at the end of the file: Ctrl-End in most editors. Etc...

I can only speak to my experience, and I might be mistaken: but the reason I tend to reach for vim bindings is not because I already know them- it's because, mostly, it's consistent where as IDE key binds change depending on the platform and IDE. IntelliJ has programmable keys and they prompt you on first run which ones you'd like to use "Original?", "MacOS", "Linux". VSCode has it's own key binds for various movemen…

I get that, and consistency is great.

But consistency only exists within a "culture", such as Linux or Windows.

From the perspective of someone from Windows, VIM is hilariously inconsistent, to the point of absurdity.

Most editors on Windows share a relatively consistent set of navigation commands. Ctrl-Left-Arrow for previous word, Ctrl-End for end of file, etc...

VIM meanwhile is so far away from this it's basically from another planet.

So then from your perspective VIM is consistent and consistently available. From a Windows user's perspective it is the Windows standard editors that are consistent and consistently available.

That's why I've gone on rants previously about the bizarre hybrids like VS Code, where it does some things like VIM, but pretends to be a light version of Visual Studio. It's a garbled mess, but apparently I'm not allowed to criticise it because it is free and JavaScript people had nothing as good available to them before, so it must be the best thing since sliced bread...

Re: Vim Anti-Patterns That Cause Beginners To:Quit

#49

There's been a number of "anti-vim, use a real ide(TM)" posts coming into my feed lately and I don't get why. Do people really get buttmad about this? I switched from vscode to vim as I found it to be largely much faster in getting around when I started my new job, some people find the opposite. A ok. Why do people try to force us into these largely closed solutions? ( Mainly it's vscode, which has a real EEE threat)

I've never gone for vi(m), even after roughly 25 years of using Linux now.

I'm not trying to force you into anything, certainly not anything closed. I used NEdit until its lack of utf-8 and ancient GUI library started causing trouble. Then I used Slava Pestov's JEdit, which was wonderfully extensible and portable. Now I use vscode, which is just so outrageously well made that even electron and Microsoft can't scare me away from it. All are open source. (Don't know what you mean by EEE threat, googling it doesn't help.)

But modal editing is just a bad idea. We've known since the 70s. One of the most solid things to come out of behavioural psychology was the idea that switching contexts - so that the same thing does something different - has a cost, and isn't a great idea when designing a user interface. Imagine you had a car with stick shift. But you also had a little button on the dashboard, which, if you pressed it, toggled so that the stick shift controlled your car radio instead of your gearbox.

Obviously, that would be a terrible idea. Still, people might get used to it. They might even get so used to it that they would defend it and complain when the feature wasn't there.

All I see that's really different about modal editing is that the stakes are lower when you make mistakes. But it's, bizarrely to me, become a matter of prestige and pride for some to use an antiquated UI design. I'd understand it if you grew up with it, but odds are you didn't. Even the guy who tried to push it on me back in the 90s didn't either. It's like everyone's zipping around in electric cars, and some people still swear by those gear/radio sticks.

Re: Vim Anti-Patterns That Cause Beginners To:Quit

#50
post #9

I just don't buy the premise that I will profit from spending a lot of time optimally customizing a text editor to my supposedly very unique and special needs. Seems more like a weird para-work hobby than an actual productivity hack.

Then don't. Just learn the basics. Learn how to use insert mode, edit some files, ignore anything not directly relevant. Eventually you'll come across a particular use case where opening a full blown IDE doesn't feel worth the effort, so you'll open vim. You'll learn a few shortcuts, because it would be nice to delete an entire line, or just look at the end of the file. What do you know `dd`, and `G` respectively do…

I don't think I've ever come across a use case where opening an IDE didn't seem worth it. I've never come across a use case where I though vim was the better option. There are many times I had to use vim because I didn't have a choice. And usually it was with the thought, that I have to one again use a hacked up line editor.
Post reply on HN