Live data from Hacker News

How Did Vim Become So Popular?

pragmaticpineapple.com

441–450 of 507 posts

Re: How Did Vim Become So Popular?

#441
post #372
post #275

Earlier quoted context omitted.

Ctrl-arrows is not the same thing as vim’s wordwise movement. If you need to go 5 words forward, it’s 5w ; if you want to capitalize the next 3 words, gU3w ; the point is composability, not a single operation. Same goes for f.

I guess I, and maybe other non-vim users, just don't see much use in the composability. From many examples I've seen in this thread, the only one I found truly interesting was the branching undo feature. For most features, the advantage seems very small, as the use-case is so rare, or it's not the limiting factor anyways. But this is very limited to my experience. I am pretty sure, if I already knew those things, I w…

I use the vim plugin inside of VSCode and it's perfect for me. I would never go back to just VIM, or just an IDE. but my best use case for vim modes is stuff like: [c]hange [i]nside ["], where wherever your cursor inside inside of a "string", you can just press ci" and can immediately start typing a new string to fill it. And then this same thing can be changed to ci{ to change everything in {} to change a function, or ci( to change a function's paramaters, etc.

Then theres stuff like [c]hange un[t]ill [x], to change everything up to a certain character.

or [y]ank [i]nside ["], to 'yank' (copy) the text inside of a string and be able to paste it immediately anywhere I want to. It's verbs and sentences that you're writing in VIM modes.

Do modern editors have these kinds of keyboard shortcuts?

In general I think vim users are extremely bad at explaining why vim modes are so good, as I never use 5w. Am I really going to count how many words ahead I have to go? No, i'll just press [f]ind char to the word I have to go to.

The biggest thing about vim is that it doesn't make you more efficient or faster, it just eliminates the time you have to think about how to edit text once you internalize it, which I know doesn't sound likely because the keybindings are so strange. But know that I've learned it, i genuinely don't think about it, and every time I'm not in VIM and have to move my mouse and click on a character I feel like I lose my train of thought of where I was in the code

Re: How Did Vim Become So Popular?

#442
post #359

I know I'm going against the popular opinion here, but I have never observed anyone using either Vim or Emacs to outperform a competent IDE user, especially Visual Studio or IntelliJ. I mean sure, if you think IDEs are just slow, expensive text editors with fewer keyboard shortcuts, then you'll be disappointed, but features like "navigate to any symbol by prefix", "find all usages", and "Ctrl-click to navigate to def…

I think this really depends on what you work on. > Not to mention visual debuggers, not to mention remote debugging! The VS IntelliTrace feature alone is worth the cost of the entire IDE. I use gdb and pudb, which are both CLI based, and have done so for years > Visual Studio Live Share lets two people concurrently use the entire IDE at the same time, remotely: https://visualstudio.microsoft.com/services/live-share/…

> Tmux has let me do this for over 10 years

Of course, but is it as easy as two clicks in VSCode? There's so much setup to get it exactly the way you want in the terminal, where as it "just werkz" out of the box for VSCode. I'm a VIM user, but i use vim plugins inside of IDEs for this reason

Re: How Did Vim Become So Popular?

#443

Speaking personally, I've been a professional developer for almost decade and even in my relatively short career I've seen a lot of technologies come and go. I was reluctantly roped into it by my first boss, an enthusiastic Vim advocate. And since, almost nothing else (save for maybe git) beat learning vim from a return on investment perspective. From the default mac OS installation to some old Fedora box that has no…

What has always kept me from learning Vim is my non-English keyboard layout. Many of the default key combinations are impossible or require some serious finger acrobatics. Sure, I could try figuring out a new set of easily reachable and non-conflicting keybindings for my own machines, but much of my motivation for learning it in the first place was being able to work on remote machines more comfortably.

Interesting point, and a good reminder of how anglocentric the computing world is in some ways. Do localized IDEs typically take this into consideration?

Re: How Did Vim Become So Popular?

#444
post #99

Earlier quoted context omitted.

copy 10 lines from the current position into buffer q, go to the start of function jnk, copy 5 lines into buffer w, jump to line 10, paste contents of q, contents of w, and contents of q sequentially one after the other: "q10yy /jnk "w5yy 10G "qp "wp "qp now, go to the start of the document and indent the next 20 lines by 10 spaces: 0G .,+20s:^: : ok great, now find JUNK and replace 'a1' with 'A1' in the 15 lines tha…

Thank you for that example! Just thinking out loud how to do that in vscode for comparison: - I don’t think repeating actions a specific number of times makes sense in most use cases. Counting 10 lines would take longer than doing shift up/down n times (which would be exact with feedback) to select the desired lines. - Multiple Copy Paste buffers sounds interesting, I might look up a vscode extension for that. (Had a…

cheers :)

for line counting - indeed a good point and clearly required for the examples -

After time, eyballing this becomes a skill. For things that fit on a screen (~50 lines or so, give or take) I'm usually correct 1st time or within a few lines. I can check quickly by moving the cursor (20j to go down 20, 20k to go back, repeat if necessary to get the line count)

also as others have pointed out, I might not be doing the best/optimal thing for some of these, just some examples of how I do things that popped in my head :)

Re: How Did Vim Become So Popular?

#445
post #349

I think it's a bit sad that the article completely fails to mention that Bram Moolenaar originally implemented vim on the Amiga. Actually this might have contributed to its popularity: back in 1991, Amigas were much more widespread than Unix boxes, and around the time Commodore went bust and the Amiga was no more, i imagine lots of developers migrated to then-new Linux rather than to the despised DOS/Windows, and too…

I was reminded that Amiga was bought by Gateway which sounds crazy but it was 1999, that was wackyland times

Re: How Did Vim Become So Popular?

#446
post #99

Earlier quoted context omitted.

copy 10 lines from the current position into buffer q, go to the start of function jnk, copy 5 lines into buffer w, jump to line 10, paste contents of q, contents of w, and contents of q sequentially one after the other: "q10yy /jnk "w5yy 10G "qp "wp "qp now, go to the start of the document and indent the next 20 lines by 10 spaces: 0G .,+20s:^: : ok great, now find JUNK and replace 'a1' with 'A1' in the 15 lines tha…

I find it interesting how we use vim so differently. I'd never type "10yy", I'd use "y9j". I never use "10G", I use ":10 " ( = enter for those not familiar). Similarly, "0G" is "gg" for me. Call me a notepad user, but that whole second snippet for me would be "ggV19j>" followed by "." until things lined up correctly. Similarly, the third would have been "V14j:s/a1/A1/g". Nit pick: "q selects register q. A buffer is a…

yep - probably a few ways to do things and I might not be doing the cleanest, just the way I learned/figgured it out

Re: How Did Vim Become So Popular?

#447
post #335

Earlier quoted context omitted.

What a great test, and it makes sense - a craftsman cares very much about their tools, an average tech will use the first thing that they're taught.

You become used to the first tool you pickup, its ways become "natural", and hence you become opinionated.

I don't know about that, my first tool was vi, I have strong opinions about it :-). I use an all singing IDE (Appcode) now, its not perfect either but works for now.

Re: How Did Vim Become So Popular?

#448
post #341

Earlier quoted context omitted.

I'm not going to argue with your personal choice or that you should spend time configuring vim. I'll just point out that the things you've discussed are possible in Vim if you want them. E.g. live-templates (snippets) https://github.com/neoclide/coc-snippets and that if you don't want to spend the time configuring yourself projects like https://spacevim.org/ exist. Now there probably are some IDE features that vim ca…

There are things like refactoring which technically are supported by vim extensions, but are just utterly inferior to the dedicated IDEs. For example - you know "extract method" refactoring. Pretty basic thing and I assume vim can do that. But on top of that when you extract the method, Intellij will go through rest of your code and try to figure out if some other parts could be automatically refactored to use this n…

That sounds very useful and it's not something that vim gives you out of the box but I'm not sure that anything you're describing is not possible via LSP plugins and extensions.

Running a server to automatically search for duplicate code sounds exactly like the kind of task that LSP can handle.

Since VSCode has tools for deep flow analysis (although I can't say how they compare to Intellij) then I'm pretty sure I can access them from neovim.

Maybe if I was a Java developer something like Intellij would look more attractive but I've never really been impressed with the rest of the JetBrains IDE family.

Horses for courses I guess. If there's some tool you want that's only available in Intellij then that's what you'll use.

Re: How Did Vim Become So Popular?

#449

Controversial comment here, but I would say Vim isn't popular at all. I would say instead, Vim advocates are incredibly vocal (a bit like Vegans and Crossfitters) and won't hesitate to talk about it at all times. I've been engineering now since 2002 so approaching 20 years and sure, every office has one guy who's the "hardcore" Vim guy. Everyone else in the office uses Visual Studio or VSCode, Atom, Sublime, IntelliJ…

Software engineering is far bigger than your niche.

Re: How Did Vim Become So Popular?

#450
post #422
post #276

Earlier quoted context omitted.

You're going to have to explain that one because I generally switch back to command mode after every edit so I use ctrl-[ a lot. I'd be VERY interested to hear why that's wrong and what you do differently.

my reasoning was : you could have mapped caps lock to ESC but you did not. So maybe you are using CTRL too much (CTRL-V maybe?) which is not the best way to use vim.

No your reasoning is way off. I map to ctrl rather than escape because I want to make use of the Insert and Ex mode ctrl shortcuts.

For example, if I want to insert a register into the ex mode command line I use ctr-r .

Or if I want to pop out of insert mode for a single command I use ctr-o.

E.g. inserting opening and closing tags when a suitable plugin isn't present. Insert the opening and closing tag, jump back to command mode with ctrl-o, move backwards and you're ready to insert more text.

Post reply on HN