Live data from Hacker News

How Did Vim Become So Popular?

pragmaticpineapple.com

201–210 of 507 posts

Re: How Did Vim Become So Popular?

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

I vaguely remember there is a plugin that does multi line edits - what I never found useful.

I personally would rather use :s (search-replace) for that. Regexp is your friend.

Re: How Did Vim Become So Popular?

#202

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…

One vim hack I like is multi-line macro application. It's a good fallback in case, as I often forget the syntax for certain things. To facilitate this, I've remapped ctrl-space in visual line mode to apply my `q` macro to every selected line.

As an example, say I need to add a comma to a bunch of lines. I will record the macro on that line appending a comma to the end, visually select all of the other lines to copy the macro on, and then jam my hotkey to apply the macro.

It's often much quicker than reaching for a regex for short segments of code.

Re: How Did Vim Become So Popular?

#203

Back in ye olden tymes, you could count on some variant of it being everywhere. It’s lightweight, ubiquitous, and powerful. It’s way more powerful than default Windows tools. There’s a steep curve, but if you can handle it and learn a couple of things (%s//g) being one of them, you’ll get people hooked. Then the olds shame the young staff to use it. The muscle memory aspect is significant too. I’m a suit now, but can…

> Back in ye olden tymes

Not just olden times. It is easily found on literally any Linux or Mac system.

Re: How Did Vim Become So Popular?

#204

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.

do you use backspace to delete things ?

Re: How Did Vim Become So Popular?

#205

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…

Google "vim golf"

Re: How Did Vim Become So Popular?

#206
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 are things that vim does better. There are things that VS Code does better. There are things that Visual Studio does better. You can memorize all sorts of things about your particular editor of choice and you will be more efficient and effective in that editor.

If I wanted to cherry pick examples of what vim does better, I could start all of them with, "first ssh into a random server."

What makes vim great is that it has a tremendous number of features and is available nearly everywhere. Can VS Code do that?

Re: How Did Vim Become So Popular?

#207
post #196

Earlier quoted context omitted.

100% concur with this. I learnt Vim many years ago and I genuinely don't know what I'd do without it. It's always just there when I ssh into a new server. And the JetBrains suite has an awesome vim mode meaning I can use most (but not all) vim shortcuts with an actual IDE. 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 fi…

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

Re: How Did Vim Become So Popular?

#208

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…

I was interested in programming, don't really know why but the thought fascinated me to be able to instruct a computer to do things you want it to do. So I had tinkered with QBasic and Pascal. A friend of mine went the C/C++ route which lead to us arguing like cat-and-dog (surely out of boredom) about the various benefits.

Then we mutually tried out linux and editors. He picked Emacs, so I went with vim. Haven't regretted it ever since.

Re: How Did Vim Become So Popular?

#209

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…

If you like vimium, you may also like qutebrowser. It's built with keyboard bindings from the ground up, and is keyboard-first. I can browse most sites without taking my hands off the home row.

I use both QuteBrowser and Firefox with Vim Vixen, one of the thing that make me reluctant to switch completely are mostly addons, Multi-Container, cookies auto delete, ublock origin, Privacy Badger, ... I can't browse the Internet without those, and the built-in adblocker of QB is unfortunately not that performant. Also, you can't use the keyboard everywhere (thanks to the modern web) Random example off the top of my head: https://questions.wizardzines.com/event-loops.html

Re: How Did Vim Become So Popular?

#210

Earlier quoted context omitted.

I was wondering what language do you code in? I am a proficient Vim user but the more I use VScode for writing Python code, the harder it gets for me to justify using Vim for serious development.

If you use the right plugins + lsp, there's nothing you can do in vscode that you can't do in vim. Just requires a lot more upfront work, but you can check the config into a git repo.

The problem is finding the right plugins, but it doesn't require that much time (at least in Linux/Mac; Windows may be a different experience).

I use "IDE features" when writing Scala: vim-plug first, then vim-lsc + metals. The configuration of lsc is trivial (as in you can copy an example of less than 10 lines).

After using this for a while, I replicated the same experience in Python with python-language-server (I install it with pip --user), and it was matter of 5 minutes to setup. Before this I was using syntastic + ctags, and that required much more work.

May be is more work than getting the same functionality in VSCode, but it doesn't look a lot of work to me.

Post reply on HN