Live data from Hacker News

How Did Vim Become So Popular?

pragmaticpineapple.com

91–100 of 507 posts

Re: How Did Vim Become So Popular?

#92
Does anyone have a good video comparing vim speed coding vs vscode using built in editor features?

I’ve been using vscode for years and the YouTube videos that demo vim features are shallow (like how to enter a blank line - really?). I can do the same thing I have seen in vim videos without memorizing a bunch of strange key bindings all while being able to edit code instantly without changing modes.

I would love to see a fair comparison between someone using vim at 100% and someone using vscode at 100%.

Of course some vscode shortcuts might not be fair (like F12 to jump to definition, F2 to rename every usage, etc.)

But even in raw editing:

With vscode, I can do multi-line editing, I can navigate quickly, jump to specific words, etc all very fast.

If there is no video like this, would anyone be interested in a race?

Re: How Did Vim Become So Popular?

#93
post #76

Comes with every *nix distribution. Fast to start. I use Emacs for programming but if I have one single file, like a config file, that needs a quick edit, use vi(m) because otherwise I have to either: 1. Go to my open Emacs and navigate to the location of the file needing the quick edit 2. Open a second Emacs instance, and hope I don't lose the desktop settings for the "real" instance. Especially if the file needs to…

I'm confused by your workflow. Why are you opening a second Emacs instance?

In Emacs you just C-x C-f /path/to/config, for sudo C-x C-f /sudo::/path/to/config.

Starting location will be home, or the parent of the active file (if the active buffer is an editor).

Re: How Did Vim Become So Popular?

#94

Earlier quoted context omitted.

Alas, the emacs install base is fraction of vi/vim.

I've always assumed the opposite with how people say emacs is a nice OS and poor editor... What does Vim over emacs?

this is huge flamewar territory, but this is a bit 'off' question wise - alot of the current state of things is due to historical precedent - some details:

- (original) vi was on most unices from the mid-80s onwards out of the box

- (gnu/lucid) emacs was an additional install (not getting into other emacs flavors - original teco emacs was fairly small i believe).

- original vi just had basic editing and at some point a hardcoded lisp mode, no addons vs gnu emacs which was a programmable editing environment running within a lisp interpreter - remeber in the early days, people built whole custom hardware to be able to run lisp with sufficient complexity (see also: lisp machines, twenex, etc), so using lisp for your editor was in some sense the definition of 'overkill', depending on ones view of what an editor should do

- Also, from late-80s->90s era if you wanted a GUI for your text editor you probably used emacs, and real vi never had a gui option - put another way emacs was the only one of the two linked to gui libraries.

- vim vs vi: most obvious difference (IMHO) feature wise is that vim adds vimscript, which is an interpreted programming language, so now editing modes are extensible, etc (as was the case in emacs before). detail: vim codebase is not based on vi codebase.

since vi was just about everywhere and emacs was a (fairly large) package, you had more general vi knowledge vs emacs 'in the culture' since even an emacs user might need to know vi but not usually the other way around, and so vi (later vim, as linux distros switched their 'default vi' to 'vim') gained more install base by default. Then, people hearing about emacs likely hear the 'vi vs emacs' arguments and never try it since there are now many more choices, they've learned vi, they prefer an IDE, etc (in the old days there was much less choice, main 2 were vi and emacs, and emacs was probably somewhere on your managed LAN somewhere if you wanted to give it a shot)

most of the 'vi vs emacs' arguments are rooted in the real-vi vs fsf-emacs era and are basically obsolete in a modern vim era, since everyone is using gui library vim with vimscript, which basically means the same thing in terms of 'bloat' (both editors contain engines to display text in cli or gui mode and embed a language interpreter). Basically what was once valid internet lore kept getting past down, and the 'minimalism' of vim was confused with being 'minimal' in terms of what people meant in the original vi-vs-emacs discussions. Emacs does contain 'non editor' functions e.g. networking, etc, so the core is probably a bit bigger than the core of vim, but when people are still using these comparisons and talking about 'emacs bloat' while their preferred editor is some electron based thing, we've lost a bit of the point/message..

Re: How Did Vim Become So Popular?

#95
post #17

Earlier quoted context omitted.

Emacs + vim really are the peanut butter and chocolate of getting stuff done.

I really want to give spacemacs a try, but unfortunately I've just been using traditional emacs for far too long. vi does seem to have a much better editing model than emacs. The tools Emacs has for buffer navigation and editing have always struct me as incredibly primitive.

I've recently blown away my several years old custom Emacs config and started over with vanilla Doom Emacs (it's supposedly a faster version of Spacemacs, but I don't really know, I just took a stab and grabbed one of them). I spent a weekend doing some VIM tutorials and writing down common key strokes of things I do all the time, and then on a Monday, it was all VIM navigation. A lot of your regular Emacs meta-stuff will still work, and for that, you can slowly start replacing with the spacebar-b key stroke for your buffer management, spacebar-p for projectile, etc....

Here's a couple of the videos I watched:

1) https://www.youtube.com/watch?v=dr_iBj91eeI

2) I've only watched a couple of these for the topics I'm interested: https://www.youtube.com/watch?v=rCMh7srOqvw&list=PLhXZp00uXB...

3) for common VIM, I went with this: https://thoughtbot.com/upcase/onramp-to-vim

4) Recently, I found this guys short six-part series that gets you navigating around VIM fast, but he's an acquired taste: https://www.youtube.com/watch?v=H3o4l4GVLW0&list=PLm323Lc7iS...

There's still some things I like better about Emacs navigation and there's a lot I like about VIM navigation. I prefer Emacs crtl-a and ctrl-e for navigating to front and end of the line (instead of $ and ^, which is an awkward shift+number key on my keyboard). However, in Doom Emacs (likely Spacemacs too since I believe they both support Evil-mod) if you're in Insert Mode, most of your old Emacs navigation will still work, so this makes it a decent crutch for transitioning.

Re: How Did Vim Become So Popular?

#96

Earlier quoted context omitted.

Definitely, even now as I use emacs, I'm a 100% evil. It's just so natural (once you get it), that I don't know how other bindings (like ctrl-[whatever]) are prevalent in most other software, it's not like they are more memorable or intuitive. Fun story: I was into Free/Libre software as a teen, when I learnt how to move around in vi(m) and in my first tech gig (as a sysadmin), I was interviewed by some greybeard who…

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.

Re: How Did Vim Become So Popular?

#97
post #37

Earlier quoted context omitted.

AFAIK it still tries to stay mostly compatible with regards to how it is controlled, doesn't it? So while the internals are perhaps new, the frontend is not. But I think Kakoune https://kakoune.org would fit the bill

Kakoune is definitely an attempt at redoing the vim concept from scratch. I spent a few weeks trying it out and attempting to get used to it. Ultimately, I came away from it feeling disappointed. I think the basic premise of multiple cursors editing as a preferred model (which is what Kakoune does) is flawed. Why? Because large-scale scale changes are the exception, not the rule. By emphasizing multiple cursors, Kako…

I switched to kakoune from vim in early 2020, and I really like it (previously: emacs 1994-2004, vim 2004-2020). It's worth prefacing what follows by saying that I heavily relied on the visual selection features in vim.

kakoune provides a limited orthogonal toolset that composes extremely well. After a week using kakoune I felt at least as confident with its command language as I did with vim's after years of use. Aside from a few vim plugins that were super helpful, I didn't miss anything after transitioning, except for the 'R' command (and to a lesser extent proper integration between the 'r' and '.' commands).

I worried that kakoune's multiple selection paradigm wouldn't scale well, that it wouldn't be routinely useful, etc. On the contrary, I use multiple selections heavily, often as a more ergonomic alternative to recorded macros, constantly for rectangle-based operations (whether multi-line editing, indenting, ASCII art creation, whatever).

Oh, for you tmux lovers out there, kakoune integrates amazingly well. All of its multi-window functionality directly uses tmux panes, with a server application (think emacs-server) tying everything together.

In terms of ecosystem, vim is much richer. But kakoune is a practical, beautifully designed tool.

Re: How Did Vim Become So Popular?

#98
post #2

> What I am trying to say that vim is an effort of over half a century of good idea accumulation, putting lots of effort into being backward compatible. I wonder what Vi(m) would be like if it were redesigned from scratch.

Vi came about before CUA. If I was to design it nowadays I'd use 'c' for copy in normal mode, 'ctrl-c' for copy in insert mode, and keep that pattern as far as practical to ease the learning curve for people new to the editor.

Re: How Did Vim Become So Popular?

#99

Does anyone have a good video comparing vim speed coding vs vscode using built in editor features? I’ve been using vscode for years and the YouTube videos that demo vim features are shallow (like how to enter a blank line - really?). I can do the same thing I have seen in vim videos without memorizing a bunch of strange key bindings all while being able to edit code instantly without changing modes. I would love to s…

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 that follow:

/JUNK .,+15s/a1/A1/g

probably not as efficient for multi-file refactoring, but for raw 'drag race' style text munging, everything is there, loaded in muscle memory, and under the home row of your keyboard so you don't have to lift your hands at all.

Post reply on HN