Live data from Hacker News

How Did Vim Become So Popular?

pragmaticpineapple.com

261–270 of 507 posts

Re: How Did Vim Become So Popular?

#261

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

Emacs is more complex, and Emacs users do more in Emacs than just edit text. (think org-mode, debugger frontends, mail readers, etc.)

Re: How Did Vim Become So Popular?

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

> Counting 10 lines would take longer than doing shift up/down n times

Vim get round that by providing the option of relative line numbers to the current line.

That’s accessed via

  :set relativenumber

Re: How Did Vim Become So Popular?

#263
post #207
post #196

Earlier quoted context omitted.

>>I don't think vim itself works well as an IDE substitute, and wouldn't use it for hardcore web dev for example - but for quickly editing random files there's nothing that comes close. Exactly my thoughts, you need vim and emacs these days if you want to munge through large amounts of text. The thing is in these days of Kibana and Elastic search. You don't do much of this kind of work anymore. Code is text. But it's…

I'll argue that the IDE is Unix, not vim, I recently started and endeavour to vanilla Vim and I was baffled by what is possible even without plugins, granted I mostly work with C and a bit of Python, but one thing to consider is that most people using Vim come from an IDE background, so horse for course I guess. https://sanctum.geek.nz/arabesque/series/unix-as-ide/ Edit: Link

Unix is not an IDE. The I stands for integrated. Unix is just a good old development environment...

Re: How Did Vim Become So Popular?

#264
post #253

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…

This is really interesting. I'm quite the opposite. I keep trying to make vim my main devtool but I just can't stay away from a fully fledged ide. At the same time, having heard from literally everyone that once you do get used to it, vim is way faster to do everything in. What advice do you have for someone like me to proper get used it once and for all? Are there any good resources you used to learn all the vim sho…

Same as you. I've ended up accepting that whatever the features or the plugins, the UX constraints in terminal editors (1-character unit of space, colors, graphical plugins...) will always be a huge limitation. That's reason enough to convince me to use VSCode or Webstorm with a vim plugin

Re: How Did Vim Become So Popular?

#265

Earlier quoted context omitted.

> switch to command mode Why? Just use the 'relativenumber' option and do 5j. > the second way is more popular in vim too. Maybe for moving down 5 lines, but (I hope) not for things like "replace the inside of the brackets with what's in my A register". Otherwise you're really better off using a different editor.

> Why? To be sure that the editor isn't in insert mode. Using another slot of short-term memory to keep an editor's mode seems wasteful.

Contrary to popular techy opinion, short-term memory is not composed of hard, fixed "slots" that fill up and overflow. It's not like remembering one more byte of information will make a variable name fall out of your memory on the other end.

Besides, it might just as well become something you don't need to use memory for at all - just press Esc to make sure. If you're in command mode, nothing happens. If you're in insert mode, you've entered command mode.

Re: How Did Vim Become So Popular?

#266
post #207
post #196

Earlier quoted context omitted.

>>I don't think vim itself works well as an IDE substitute, and wouldn't use it for hardcore web dev for example - but for quickly editing random files there's nothing that comes close. Exactly my thoughts, you need vim and emacs these days if you want to munge through large amounts of text. The thing is in these days of Kibana and Elastic search. You don't do much of this kind of work anymore. Code is text. But it's…

I'll argue that the IDE is Unix, not vim, I recently started and endeavour to vanilla Vim and I was baffled by what is possible even without plugins, granted I mostly work with C and a bit of Python, but one thing to consider is that most people using Vim come from an IDE background, so horse for course I guess. https://sanctum.geek.nz/arabesque/series/unix-as-ide/ Edit: Link

IDE has syntactic understanding of your code, which allows you to navigate your whole codebase as if it's one big hypertext document (invalueable especially when learning new code). Also, the syntactic understanding allows you to do one-click fairly complex refactorings with guarantees that nothing will get broken (at least it works for sane languages, like Java. I don't know how well it works for C/C++, where preprocessor macros complicate things). I don't see how "UNIX as an IDE" delivers this.

Re: How Did Vim Become So Popular?

#267
post #228

Earlier quoted context omitted.

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…

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

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?

#268
Perhaps a mix of choice supportive bias after going through the pain of learning it and stockholm syndrome?

Jokes aside, I don't really work with VIM but understand the concepts and have mastered basic usage of changing text files without too much effort. Never really coded in VIM aside from small scripts. But it is a dependable text editor that survived the ages. Most modern IDE will never reach this because they are far less dependable and far less wide spread. Installing VIM on your system never hurts.

Re: How Did Vim Become So Popular?

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

Ok, also am curious about multi-insertion with cntr-left/right that vscode does: For example, let’s say I have a json object with variety of field names, one per line and I want to remove the quotes. With vscode, I can alt select all lines, Home Ctrl+right del cntl+right del. The trick is the field names are different length, does vim have multi-edit with the ability to navigate relative to each insertion point? Edit…

There's a couple of ways you could tackle editing that depending on what your json looks like.

For example you could use the visual block mode (ctrl-v) and highlight to the end of the line using $ and then use A to edit the end of every line at the same time. That works with lines of different length.

Or you could use a regex inside of a block selection.

Or there's a multi-cursor plugin available for the same approach as you're currently using in VSCode:

https://github.com/terryma/vim-multiple-cursors

Vim Golf is an excellent resource for seeing how to efficiently edit things in Vim: https://www.vimgolf.com/

Re: How Did Vim Become So Popular?

#270
post #217

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…

(Funnily enough ctrl-[ is one of my most used shortcuts in vim. It’s a convenient alternative to escape if you map caps-lock to ctrl)

I've been using ctrl-[ for years, but have been experimenting with jj. Now I'm not sure which one I like better!

I switched back to vim+tmux (nvim) a few weeks ago from a number of years using vs-code with the vim keybindings.

I'm still trying to configure my plugins so that I don't feel like I'm repeating myself too often.

Post reply on HN