Live data from Hacker News

How Did Vim Become So Popular?

pragmaticpineapple.com

151–160 of 507 posts

Re: How Did Vim Become So Popular?

#151

Earlier quoted context omitted.

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

I am also surprised by this. What are you basing it on? For arbitrarily comparable online communities, it looks like emacs.stackexchange.com is twice as active as vi.stackexchange.com

Vi users RTFM.

Re: How Did Vim Become So Popular?

#152
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.

Highlighting the initial { of a function and then typing 'va}' ('v' for entering visual mode, and 'a}' moves to the matching close brace. Similar commands work the [], (), and pairs) selects the entire function body. From there, a regular s command will operate on the entire selected text.

Re: How Did Vim Become So Popular?

#154

In my opinion, the best feature of Vi(m) is its ubiquity. Also, it is fast and reliable. That said, I never bothered learning many commands, only the very basic ones, I spend much more time thinking than typing anyway and I always felt the productivity gains to be marginal.

If you're on a linux server, it almost always has vi(m). It's worth learning for that reason alone :)

Re: How Did Vim Become So Popular?

#155

Earlier quoted context omitted.

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

Highlighting the initial { of a function and then typing 'va}' ('v' for entering visual mode, and 'a}' moves to the matching close brace. Similar commands work the [], (), and pairs) selects the entire function body. From there, a regular s command will operate on the entire selected text.

Mine is v% :)

Re: How Did Vim Become So Popular?

#156
I used Vi, and then Vim, for a good 15y before I switched to Emacs. I made the switch because I had heard that Emacs let you manipulate your buffers with lisp as one would any other data in a programming language. I find I only really do that when using Org Mode or REST mode, but I'm still glad that I made the switch. The editor is ... mine. Mine in a way that a professional's tool should be an extension of themself.

I've been thinking of trying evil, but I don't really miss the modal editing as much as I thought I would, and it's been another five to ten years.

Re: How Did Vim Become So Popular?

#157

Earlier quoted context omitted.

One editor which used to be great at this is sam, which was explicitly designed to work across slow links, by being split into a frontend running locally, and a backend being run on the target host: http://sam.cat-v.org

An alternative to that is to run mosh and it will make assumptions about where the characters should be going.

Mosh is so good if you commute and work via LTE

Re: How Did Vim Become So Popular?

#159
post #111

Regarding the picture of the woman standing next to the pile of punch-cards which is, annoyingly, uncredited, I have found it credited in this article [1] as: > Programmer standing next to the SAGE computer's control program > Image courtesy the Computer History Museum and the MITRE Corporation [1] https://kiranbot.com/post/2016-07-27-punch-cards/

I really need to show that picture to my in-laws. They met while working at MITRE during that era, and there's an excellent chance they knew that woman.

Re: How Did Vim Become So Popular?

#160
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.

If the language uses curly braces to define blocks, it's easier: ciB. Parentheses are easy as well: cib. Otherwise, I'm not sure there's a good solution currently. You can substitute by indentation with a plugin (https://github.com/kana/vim-textobj-indent/blob/master/doc/t...). For Lua, I usually do c/end.

I believe this is an area where treesitter can help, so I'm looking forward to Neovim's integration.

Post reply on HN