Live data from Hacker News

Don't use Vim for the wrong reasons (2020)

gist.github.com

41–50 of 85 posts

Re: Don't use Vim for the wrong reasons (2020)

#41
The real reason to learn vim is so you can login to any linux server and edit.

You learn it and if you enjoy it you can go deeper. I use VSCode on my desktop and I’m not about to give up a graphical IDE, but it’s great to be able to ssh into any linux server or container and be able to efficiently edit with just a keyboard when you need to.

Re: Don't use Vim for the wrong reasons (2020)

#42

This is four years old. It was outdated at the time it was written, and now it is woefully outdated. For example: > From sketchy terminal integration, to being single-threaded, via the lack of anything resembling a proper internal plugin API, nothing in Vim can be leveraged to give you a convincing Integrated Development Environment. https://neovim.io/doc/user/api.html

I was thinking the same thing - granted, the OP is technically referring to Vim and not NeoVim. Still, today’s terminal integration is incredibly smooth, and Lua in NeoVim has been a dream for someone who spent way too long attempting to learn VimScript and has never written a lick of Lua in my life.

Re: Don't use Vim for the wrong reasons (2020)

#43

What is the consensus on productivity with Vim? I have thought about trying out the keyboard only approach, but haven't wanted to invest time in it yet. When I see people on YouTube using Vim it slightly feels like there's a whole lot of keypresses happening, but not a lot is actually gained compared to using a mouse or even frequently it seems it takes a while to do something that is much quicker with the mouse. I u…

> how do people feel about the productivity

I think maybe you shouldn't focus on the "productivity" - that's a fairly arbitrary metric, and difficult to measure - it often has more to do with how many bugs you have, how organized you are, and what you are trying to accomplish, how good friends you are with your boss/customer, and very little to do with which editor or what keybindings (or which language, even).

Instead, it is better to think about communication protocols - for a second consider something like the internet - something like handwaves, gestures, while theoretically analog and hence containing infinitely more data, they are very difficult to transcribe, send to the other side of the planet, and interpret.

I'm not saying these things cannot be done, but I imagine the internet would not exist if we had resorted to using thumbs up/down as our method of transferring information between "computers". We used a more appropriate, binary-based, protocol, and now we can send characters and have discussions! Maybe even include a couple hand-wave emojis!

Editors like vim/emacs are similar, they "feel" more productive because they are in some sense, "closer" to the code than a mouse can be. If I mainly am using a mouse (nothing else), then I probably should not be writing code at all and instead should be recording my program with hand waves, or something.

I'm not saying IDE's aren't useful, but that's because programming is neither about those mad FPS skills (mouse) or nor mad text editing skills, they are built to manipulate and mangle symbols, which is what we actually use (for better or worse) to program computers.

That's one reason why I find IDEs (often coupled with an emacs keybinding) mad "productive" - I can mash shortcuts all day long and most of my code writes itself (I'm not even using AI). I'm much closer to communicating with my code/debugger than having to mouse click around. Some of the transforms/translations are sometimes odd, or the UI environment is restrictive, so I'm using the mouse then for those situations. I often, frequently, find myself "out-coding" my peers.

But a good IDE is mostly aimed at being really good at modifying/generating symbols (in the context of a project). Its not very good at text formatting (usually handled by some plugin), for instance. And where it really falls apart, there's no control, i.e. usually it is a complicated product, with lots of pitfalls, speedbumps, "I screwed up and jacked my cache please restart me". And that nixes a lot of the "productivity" gained.

So that remains where a tool like vim/emacs/notepad++ etc shines, when you need to communicate with (roughly structured) text, they won't crash on you, they won't "get in your way", they won't need you to define an AST syntax in order to understand your little mini-language, and, at least of the extensible ones, you can define whatever it is you need or want to. IDEs are usually really, really bad at that sort of thing, if you find yourself needing to do that, you'll often 1) learn to cobble something together in a script 2) learn to cobble together something approaching that in an extensible editor 3) writing a language 4) writing a plugin to write your language in your IDE, to solve whatever it was....

Re: Don't use Vim for the wrong reasons (2020)

#44

Ironically text editing is the thing I like least about vim. I would switch to an IDE if it provided the level of programmability Vim has. For example, I have a binding which, when used on a netlink command, opens the corresponding implementation in the kernel. How do you do that in something like VSCode? I guess I could write an extension, but in Vim it takes like 2 lines of code that you write once and forget about…

The ability to quickly and easily(-ish) script vim is incredibly useful. At one point, because of environment constraints, the easiest way to run unit tests was either to run them all or to specify the file I wanted to test. A little bit of googling and playing around and I had Vim read my current spec name, chop it up to find the correct source file name, spawn a terminal and run the test command using that source name anytime I wrote a change.

Thankfully I’m somewhere with sane tooling that watches for changes and only runs relevant tests, but back then this little foray into “how do I make Vim do a thing” saved me a ton of time.

Re: Don't use Vim for the wrong reasons (2020)

#45

I'm a big fan of Vim, but I hardly use it as my primary editor anymore (applies for Neovim as well). I think the ecosystem is amazing, but I hardly have the patience to set things up to feature parity with other editors. Debuggers are the biggest missing/hard to configure feature. I do, however, use Vim bindings in every editor that supports them (and extensions for browsers like Vimium). The extensions/Editor functi…

Mason brings a lot of what I needed for LSP, and their DAP servers are getting better. Debugging in (n)vim will likely remain a fun trudge for a while but it is getting better.

I found a lot of issues with trying to get a “good” setup, or got frustrated that moving from one job to another meant attempting to port my working setup to a new machine and new projects. I recently went back to NvChad and have done almost no custom config and I love it.

Re: Don't use Vim for the wrong reasons (2020)

#48

What is the consensus on productivity with Vim? I have thought about trying out the keyboard only approach, but haven't wanted to invest time in it yet. When I see people on YouTube using Vim it slightly feels like there's a whole lot of keypresses happening, but not a lot is actually gained compared to using a mouse or even frequently it seems it takes a while to do something that is much quicker with the mouse. I u…

Very simply, for me, keeping my hands on the keyboard feels right and means less movement overall. If I’m typing and want to correct something two words back, say “how rae you?” I can either

- grab my mouse and click where I want the cursor, fix the typo, and then click back to where I was (or hit End, or was it Ctrl+Right? Opt+End?)

- type Faaar$

Ok, that’s a lot of weird keystrokes, but in my brain my hands just did “jump back to the a in ‘rae’, delete the ‘ra’, type ‘ar’, jump to the end of the line”.

Over a decade of Vim later and these motions are second nature to me, and using my mouse is usually reserved for the times I’m not in Vim. I can’t say I’m faster or more efficient, but I know how to get my cursor to exactly where I want it and how to manipulate, move, copy, delete, etc, in a way that feels natural and intuitive.

Re: Don't use Vim for the wrong reasons (2020)

#49

> if you think it's everywhere One of the counterpoint is vim not being available on Windows. But It is. Not by default, but most critical stuff aren't there by default anyway and vim will be one of the easiest block to have ready. Then Windows comes with WSL, where I think most people who even care in passing about vim will spend their time, so we're back to the editor they'd use on Linux anyway. That was to me the…

At the time of writing, the supposed ubiquity of Vim, or rather Vi-clones, was often touted as a strong selling point by people with a severe case of Linux-myopia. The "counterpoint" is not that Vim is not _available_ on Windows. It is that Vim is not on Windows _out of the box_. You must install the native binary to have it or, like you suggest, install _another system_ on your machine… that actually comes with Vim.…

I'm with you on vim not being there out of the box. I mean, even on Debian it's not in by default.

But I also feel that ship has sailed for most software. We joke that windows/macos's default browser is only there to go install Chrome/firefox or any other browser of choice, and I see the wider reality of it as most OSes requirement a decent amount of installation to get to a usable point, even for very basic tasks.

It's still easier to use software that is mostly available everywhere in mostly the same shape and form (also why so many people bet on VSCode I think)

Re: Don't use Vim for the wrong reasons (2020)

#50
post #46

I hate those YouTube videos "turn vim into an IDE". The people who watch those only care about bragging that they use vim, nothing else.

imaging being so disconnected from reality to think that your editor of choice if something to brag about

One could say the same about any interest, really...imagine bragging what sort of car you drive, as if that makes any real difference.

Of course, you say, driving some expensive car means you get more attention, right? Well, yes, and it doesn't make you any better of a person...if your text editor is your car and people care about what car you drive, then maybe it also gets you some attention...

But yes it is sad that we get wrapped up in the unimportant things in life. Good to have some escapes, too, though.

Post reply on HN