Live data from Hacker News

How Did Vim Become So Popular?

pragmaticpineapple.com

331–340 of 507 posts

Re: How Did Vim Become So Popular?

#331

Earlier quoted context omitted.

I've used Emacs for many years, and recently switched to Spacemacs, a set of configs that kind of takes over Emacs and puts a great platform on top of it. I frequently describe Spacemacs as a better vim than vim. Don't get me wrong, I've used vim for ages; I'll never stop editing server config with vi, nor will I stop getting mad when vi is actually vi and not vim. But for a day to day code editor? Spacemacs is aston…

The problem with Emacs and all its modifications is that it cannot match Vim's flexible system for custom keybindings. And because of that Evil mode has the same limitation, beside its insistence to prefer using builtin Emacs functionality over emulating Vim behaviour correctly. And the other thing that I could never get used to is that Emacs' terminals can't handle ncurses applications. I usually like to run Vim in…

> The problem with Emacs and all its modifications is that it cannot match Vim's flexible system for custom keybindings.

Interesting, my impression was that custom keybindings was more flexible in Emacs + Evil than in Vim. It seemed easier to e.g. define new modes with separate keybindings, and if you use the GUI version, more distinct keybindings are available.

> And the other thing that I could never get used to is that Emacs' terminals can't handle ncurses applications.

It can now. The problem is that there are a lot of shells and terminals available in Emacs, so it's not always obvious which one supports what. But emacs-libvterm [1] is a "real" terminal inside Emacs, and supports ncurses apps well. (The website warns about being alpha level, but I used Emacs + Evil for about half a year, and it worked fine for me.)

[1]: https://github.com/akermu/emacs-libvterm

> I'm fine with Vim, but I'm glad I tried Emacs for a while because it does have some nice ideas.

I ended up with the same conclusion :).

Re: How Did Vim Become So Popular?

#332
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…

> now find JUNK and replace 'a1' with 'A1' in the 15 lines that follow The real scenario is usually to replace, for example, in a function block. How do you do that? Counting function lines seems like a non-starter.

You know these aren’t new issues, right? Vim has been around since 1991 and back to 1976 from Bill Joy’s editor.

Of course Vim can replace a function block easily and has been able to do so for decades.

Re: How Did Vim Become So Popular?

#333

Earlier quoted context omitted.

This is like someone saying they've used a DSLR professionally for a decade and couldn't say what benefits they get out of it over a point and shoot because they've never done anything other than leave it in automatic mode. You owe it to yourself to explore and embrace the power of your tools as a professional. Vi(m) in particular requires a deliberate effort from the user to learn its features, because of how it sta…

I’m pretty good at using vim, There’s really nothing I don’t know, and I’ve watched tons of courses and read tons of tutorials. I got my own vimrc like plenty of people. But People still use macvim, and hit Apple S, and Use the mouse, I’m hardly the only one. See Yehudas “everyone who tried to teach me to use vim was wrong” When I was younger I cared more about it, but it’s all just yak shaving. What there isn’t are…

Hey just wanna let you know that I'm a fellow Vim user that uses the mouse for practically everything. I like using Vim for editing, but my brain still likes to do the "context switch" where I dig into menus and such.

Re: How Did Vim Become So Popular?

#334
post #258
post #252

Earlier quoted context omitted.

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 p…

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…

wow i never knew these, great suggestions!

Re: How Did Vim Become So Popular?

#335

Earlier quoted context omitted.

It's proof enough that you'll figure it out. Years of interviewing people for my own teams has shown me that understanding your tools (especially to the point of being opinionated about them) is probably the #1 indicator of success.

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.

Re: How Did Vim Become So Popular?

#336

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…

Right, but coding is just one specific use of vim. Vim is a tool for a world where everything is a text file, eg:

- focused mode essay writing

- editing ~/.config/thing.json

- formatting a shopping list

- cleaning up scanned text from a PDF into markdown

- opening an encrypted password file and adding your home insurance renewal details

- writing up notes on a job contract

...and that’s just two hours into my day. Vim is general purpose. IDE usage isn’t mutually exclusive. When I need API aware typeaheads then I also reach for REPL.it.

Re: How Did Vim Become So Popular?

#337
post #218

Earlier quoted context omitted.

Ctrl+arrow is almost as bad as going to the mouse. The thing with vim is you rarely have to leave the home row. Some other random things I use constantly (I am not the person you're replying to): C — replace to the end of the line xp — swap two characters (which I have to use more frequently than I'm willing to admit.) ci( — replace everything in brackets (like the arguments of a function, this also works with " or '…

> :earlier 10m — time traveling, which comes in handy between commits or with config files, especially if you configure vim to write persistent change history. What did this file look like a month ago? Oh yeah, :earlier 30d Another trick to my bag, that's why I absolutely love these threads about Vim.

:later also works (hence the joke that you can just hit :later 8h and go home...)

Re: How Did Vim Become So Popular?

#338

I’ve been using Vim professionally for like ten years now and I can’t tell you what benefits do I get out it exactly. I still use a mouse and I don’t see what’s so bad about it.the whole home row argument has never been convincing.

I really like how Vim is set up, even if I don't personally use the home row stuff. I just like the stability of the interface, its simplicity, and performance especially. I used to get really obsessed with editor stuff, then I realized I was wasting my time and that Vim was already installed on every machine - no additional install ever needed to set up the environment. I usually only ever add one or two lines to my vimrc (jj -> Esc). I like that it just works.

If I ever need to do refactoring I'll download CLion and get the engine running and fans spinning. But I do more debugging and reading code than refactoring it.

Re: How Did Vim Become So Popular?

#339

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…

You can share Vim, Emacs, and your entire terminal with other engineers using Tmux or Screen. You can remote debug with GDB. You can navigate to any symbol by prefix in Vim using regex. You can "find all usages" via :Ag whatever-you-are-looking-for. Just because you don't know how to do it doesn't mean it cannot be done.

I'm a big user of vim and use the vim plugins in whatever IDE I'm using. But I have to say I don't find this sort of argument very compelling:

> You can share Vim, Emacs, and your entire terminal with other engineers using Tmux or Screen.

I've needed to do that maybe once. People aren't usually very proficient with tmux/screen anyway, and clearly even less with your flavor of emacs or your vim setup. VSCode live share does that too, but whoever you share with will have their own plugins (+ you can share servers, terminals, etc)

> You can navigate to any symbol by prefix in Vim using regex

Any IDE has navigation by symbol built-in, and it's usually faster than typing regexes

> You can "find all usages" via :Ag whatever-you-are-looking-for

Not true, :Ag will find occurrences not usages, it's not aware of the AST (that I know of). IDEs have specific language-aware functionalities like "find implementations", "find declarations", "find usages"...

---

I'm aware these were just example of course and I'm sure there's things that vim does better, but the only real value I got from vim compared to other editors is the text-editing model that's noticeably faster when you're proficient at it

Re: How Did Vim Become So Popular?

#340
post #228

Earlier quoted context omitted.

There's too many little things to mention, they do all add up to be quite significant in the course of programming. Here's a tiny sample of some stuff I use constantly: Move cursor forward word at a time: w ignoring punctuation: W reverse: b B Move cursor to next occurrence of character Z: fZ reverse: FZ Delete forward to next occurrence of character Z: dfZ reverse: dFZ Change forward to next occurrence of character…

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…

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."

Post reply on HN