News for hackers. Stuff that matters.
Re:How Did Vim Become So Popular? by brabel on Wednesday July 01, 2020 @02:58AM (#23698565)
Honestly, I can do almost all of these things with any standard editor as well, with standard shortcuts.

The ones I can't do directly, I can do via Search/Replace functionality that is also standard in most modern editors.

Your example about refactoring a function by using text editing capabilities is actually pretty bad unless you mean Vim can actually parse your programming language and perform the refactoring over all your code-base (not just a single file), like any IDE will do.

This list you gave me just convinced me I don't need Vim.

Re:How Did Vim Become So Popular? by harisund on Wednesday July 01, 2020 @03:34AM (#23698834)
Here's the real question - So you are convinced you don't need Vim, right? Why are you on this thread?

No one's saying vim is superior. However, you need to have an open mind to understand the alternatives.

It's not like Vim is a paid product and by you not using it, Vim is going to die out soon or anything.

If you dont' like it, great? You are happy with the alternative, great. You seem like you just want to deliberately start an argument and then prove you are right, but why?

Re:How Did Vim Become So Popular? by brabel on Wednesday July 01, 2020 @06:13AM (#23699857)
I am in this thread because this is not a thread about how Vim is great, it's a thread about how Vim became popular, which I honestly don't understand in a day and age where modes are completely unnecessary. I see lots of happy Vim users telling the rest of us how they are so happy with Vim and they can't understand how anyone can do anything without it... so I thought I should point out I feel extremely productive on any non-mode text editor (all my shortcuts work even in this HN editor, on a browser, in Word, basically anywhere except old editors like Vim). Been programming for nearly 2 decades now and even when I started, I thought Vim was a tool from a time when we didn't have Ctrl and Arrow keys and we already had better alternatives.

At this point, I feel like "I use Vim" is like "BTW I use Arch", said usually with an air of superiority as if choosing "the hard way" was somehow smart.

Re:How Did Vim Become So Popular? by alwillis on Thursday July 02, 2020 @05:01AM (#23711321)
which I honestly don't understand in a day and age where modes are completely unnecessary.

Modes are everywhere. My microwave has a defrost mode. Cars have reverse mode. Pill bottles have modes where the bottle has to be held differently to open it.

Modelessness isn't all it's cracked up to be.

I’ve used many editors on the Mac—BBEdit, SubEthaEdit, Chocolate, TextMate, TextWrangler and a few more obscure ones.

I switched to Vim and haven't looked back nearly 10 years ago because the "modeless" editors had limitations and issues I didn't like.

I used Emacs when I worked at MIT because that's what everyone used, but it never took for me when I had to use Unix.

What the author didn't mention is that when Ruby on Rails was the new hotness, so many of the leaders in that movement were Mac users, on TextMate. But when TextMate went into limbo, and then eventually died, that tribe needed a new editor and they essentially all moved to Vim.

Many of the early Rails videos were done on Vim; they were quite influential.

I wanted an editor I wouldn't outgrow in a few months and Vim fit the bill nicely.

And to this day, I feel like I'm pretty proficient with Vim but I also know I'm using like 10-15% of what Vim can do and it's nice to know all that capability is there for when I need it.

Re:How Did Vim Become So Popular? by Lio on Wednesday July 01, 2020 @07:29AM (#23700294)
So if I understand you correctly you're angry that people choose to work in a way that you think is unnecessary and that they're just doing it to show off.

I can't speak for other vim users but I think it's pretty obvious to us how other users work without vim and we know you can be productive without it.

Personally I make a point of not telling people to learn vim but equally I think, for example, not having a shortcut to repeat a complex visual selection is a pain.

I never feel the need to enter a thread about IDEs and point out this missing feature (especially if it's a program I don't actually know well and that might not be the case).

However I often see people that don't know vim well make statements like "vim can't do x" without actually checking if that's true.

Then we look "superior" when we point out how to do it in vim.

It's hard to win because your argument sounds like an emotional one.

Re:How Did Vim Become So Popular? by brabel on Wednesday July 01, 2020 @12:44PM (#23703505)
To win what? This is not a contest or even a debate where one point of view may prevail... we're just expressing our opinions about Vim and its alternatives here. Obviously, if you like Vim, great! But it seems to me you're the emotional one if you find it necessary to question anyone pointing out they believe Vim is not a good tool at all (it promotes modals, which should have died as soon as they became unnecessary due to hardware improvements as they are objectively harder to use) and wondering why it's still somewhat popular.
Re:How Did Vim Become So Popular? by imtringued on Wednesday July 01, 2020 @04:17AM (#23699145)
I use vim as a boring config editor in terminals. I don't think it's the best editor by a long shot and even something as basic as Atom is more productive for code editing for me. The idea of customizing your vim setup for maximum productivity doesn't appeal to me. It always ended up in a mess and over ssh it's pointless.
Re:How Did Vim Become So Popular? by alwillis on Wednesday July 01, 2020 @05:26AM (#23699576)
You may want to check out “How Vim killed Atom and VSCode on my Machine”—-https://medium.com/@aswinmohanme/how-vim-killed-atom-and-vsc...
Re:How Did Vim Become So Popular? by Lio on Wednesday July 01, 2020 @03:44AM (#23698909)
One neat trick that vim has out of the box that most other editors/IDEs don’t is a tree based undo system.

So if you undo something a few steps and try something different but decide you want to go back you can’t... but you can in vim with g+ and g-

If you add the Gundo plugin you can visualise this as a tree of diffs in a side window.

I’m sure that’s been added to IDEs as a plugin but in vim it’s standard.

It also persists undo state to disc if you want so if you return to a file on another day it’s still all there.

Re:How Did Vim Become So Popular? by Lio on Wednesday July 01, 2020 @03:54AM (#23698979)
Another neat thing:

You select some text, either via keyboard or mouse. You realise you’ve missed a bit at the start of your selection.

In vim without having to start over you press o and it moves your cursor the other end of the selection and you can now extend it.

Deselect accidentally and want the selection again? Press gv.

I’m sure these little features are available in other editors but not always or not always by default.

Re:How Did Vim Become So Popular? by hellofunk on Wednesday July 01, 2020 @06:03AM (#23699794)
wow i never knew these, great suggestions!
Re:How Did Vim Become So Popular? by pengaru on Wednesday July 01, 2020 @03:08AM (#23698629)
> Honestly, I can do almost all of these things with any standard editor as well, with standard shortcuts.

WTF is a standard editor and standard shortcuts? Would that be ISO or ANSI?

Re:How Did Vim Become So Popular? by Lio on Wednesday July 01, 2020 @03:48AM (#23698934)
Also what is “almost all” in this context?

Isn’t that just another way of saying I can’t do these things but don’t care? The Blub argument effectively.

Re:How Did Vim Become So Popular? by shurane on Wednesday July 01, 2020 @07:22AM (#23700241)
So I am a fan of vim and have used it on and off for 15 years at this point. I generally use IDEs or VSCode these days instead for writing code. Here's my take.

I think the popularity of learning vim might be similar to what jiggawatts mentions as the 'perception of speed', especially for tools in the UNIX world, as well as being 'the hard way' like you mention. But I think there is value in learning how to use vim. I see the advantages of learning vim are programming language agnostic. Vim is focused around words and text, treating them as objects, and creating a mental map of keystrokes to modify those objects. I think it's somewhat analogous to typists that hunt-and-peck vs touch typists. Opens up a lot of productivity, but it's definitely not needed to be a writer.

I agree vim has many limitations. It has a not so great language for scripting, no out of the box setup for stuff like refactoring or renaming symbols in your codebase, GUI feels like a second class citizen (IMO, compared to the terminal version). In a lot of ways, it might not hold a candle to the likes of VSCode, Atom, Visual Studio, XCode, IntelliJ, Eclipse, etc.

The nice thing is that you could add a vim-like plugin to any of those IDEs/editors to match the spirit of vim, at least in terms of navigation. It's not like you need to stay in vim to reap the benefits of the mental model.

I think that's where a lot of the power and appeal of vim is. Vim is still drawing a new generation of programmers, artists, and hobbyists to learn this strange text editor, with its unique but powerful way of interacting with text.

Re:How Did Vim Become So Popular? by innocentoldguy on Wednesday July 01, 2020 @06:08AM (#23699830)
Honestly, I can do almost all of these things with any standard editor as well, with standard shortcuts.

As a 30-year Vi/Vim/NeoVim user, I can confidently say, "No, you can't."

Re:How Did Vim Become So Popular? by urmish on Wednesday July 01, 2020 @12:32PM (#23703348)
The parent described only a fraction of what vim can do. The notion of text objects and combining them with plugins makes vim much more powerful. Even without plugins mastering vim makes writing code quite natural.

https://www.youtube.com/watch?v=wlR5gYd6um0