Live data from Hacker News

I set all 376 Vim options and I'm still a fool

evanhahn.com

101–110 of 142 posts

Re: I set all 376 Vim options and I'm still a fool

#101

I never understood the appeal of these command-line editors with a million commands for different edge-cases. Why not just use VSCode? It has every possible extension you already need and a simple GUI. No need to type commands just to edit text when there's a file manager... It has remote SSH and features for vm machines. To me the kinds of people using these editors are the kinds of people that love making everythin…

> Why not just use VSCode?

Learning modal editor - vim, nvim, emacs is like skiing or snowboarding. For anyone uninitiated this whole endeavor may seem dumb - you have to spend so much money, time and effort, so you can just descent from a mountain peak to its base on a piece of wood? Absurdly bananas.

Some may even try hitting the greenest, flattest, most beginner-friendly slopes with great confidence, only to find themselves face down in the snow minutes after getting on the lift. They try again. Sometimes, falling for the fourth or fifth time reinforces their belief that it's really is dumb and they just quit at that point.

Some newbie skiers, after a few successful runs, get overly excited and head to the lift for the steeper slope, only to regret their decision. If falling all the way down doesn't make them quit, they may eventually start enjoying it.

At some point, they'd gain so much experience - their movements become smooth and graceful, their speed intimidating. Suddenly, they'd discover an enormous, indescribable feeling of joy. There's so much tacit - emotional, mental and physical enlightenment that is almost impossible to convey to another soul who's never experienced it or rose to that level.

Then there's a spectrum of differences - some still fall all the time yet enjoy it nonetheless, and they enthusiastically discuss with other beginner skiers how awesome they feel. Some, after mastering the most difficult carving techniques, somehow forget their own beginner's journey and become apathetic toward rookies.

So, then why ski [vim] at all? Well, it is truly one of the most efficient, fastest, healthy ways of getting back to the base [dealing with text]. But most importantly it's tremendously fun. Often, in quite indescribable ways. I'm afraid you would never understand the appeal until you do try it. But even then, it's never guaranteed you'd find that thrill; then maybe skiing [vimming] isn't for you. Even though these activities literally for everyone (unless they have physical/mental barriers).

I honestly can't take seriously any programmer who doesn't know the basics of vim - doesn't that suggest they've never used sed, less, or read through man pages? Have they never had to ssh to a remote machine in the terminal? I do though get it, when people say "I tried it and ain't for me". I suppose, it just means they've never hit the spot that inspired them to keep going.

Re: I set all 376 Vim options and I'm still a fool

#102
post #52

I think it took me about four months of daily use to know most of the editor basics without having to pause to look up things. Another eight for it all to feel natural. And, maybe about six years later, it remains my favorite text entry and code editing environment. I've been using the LazyVim https://www.lazyvim.org/ > neovim setup and a handful of extras, but not too many. I still have to look up some esoteric stuf…

> but lately I've been using the mouse where it makes sense Get off my lawn, hippie

hehe

Re: I set all 376 Vim options and I'm still a fool

#103

Earlier quoted context omitted.

you do not need to install it anywhere... its already everywhere ( I am vim enthusiast ) for eg: Keep right hand free for writing/eating by reserving left hand for mouse. (keep same settings for right handed mouse) Brrrr... :p

So would the use-case mostly be for people who edit lots of files over shells? I guess I was mostly thinking of coding stuff. Or do people use it for coding too?

> Or do people use it for coding too?

Over time, you may discover one of the biggest truth about computing - the immense (and sadly disregarded) value of plain text¹. Code is nothing but structured text. The cardinal job of a programmer is text manipulation.

I'm reading this thread in my editor. Why? Because I'm dealing with text - browsers are great for presentation of text, not so nice for manipulating it. What kind of manipulations? Well, I can find, sort, group, narrow, collapse/expand, translate, extract summaries for paragraphs, find all the URLs (including matching a pattern), etc. Good luck doing all that in the browser - even with the extensions.

Most developers don't even get annoyed by seemingly small things. Like how often do you need to bring the url of a given browser tab into your editor? Simplest thing, yet do it dozens of times a day and it gets vexing. For me - it takes milliseconds and a keypress - it even extracts the URL description and converts the link to markdown (if needed).

Or another example - whenever someone's screen sharing, or I'm watching a video and they show a piece of text (let's just for consistency say a url). How would you normally extract it? e.g, for your notes. For me - it takes selecting a region of screen and a keypress - my editor calls a CLI OCRing tool and voila. I don't really care that the source isn't "technically speaking" text - if I can read it, then computer for sure can "read" it too, am I right? That's text manipulation.

There may be dozens (if not hundreds) of such examples (including coding-related) in my workflow that work on top of the idea of manipulating plain text.

Once you grok the cerebral virtue of the idea of having complete and total control over text, you may find that modal editors - nvim/emacs/etc. - are the best instruments to achieve that control.

___

¹https://graydon2.dreamwidth.org/193447.html

Re: I set all 376 Vim options and I'm still a fool

#104
post #91

Earlier quoted context omitted.

It can be about as fast if you set key repeat delay to minimum and repeat speed to maximum. I used it for a while and got quite precise with it. Works well until someone else needs to use your computer for a moment...

Hm, I doubt the precision can match and avoid under/overshootings, especially at high enough repeat speed to match, and it's a global change that can affect even regular typing, so you're suggesting specialized training (to minimizeerrors) for a less effective workflow

The main issue with precise jumps (for me) is that they require you to

- already exactly know where you want to go

- figure out the relative distance either by looking to the side at relative line numbers or calculating

- move your hands to the numbers row to input numbers and back (I don't have small hands, but that still translates into a small amount of arm movement for me).

Whereas just using repeat input on jklhwe... only requires you to have a rough idea initially and leaves you plenty of time to figure out where exactly you want to stop while you're already getting there.

Besides: I don't like to think about random numbers while I'm coding. Doesn't exactly make the cursor feel like an extension of my body (imagine you had to tell your hand "move 10 centimeters left")

Another quite intuitive way I navigate is using "/something" and cycling through hits - usually you know some text that appears near the area you want to go. That was pretty much instant muscle memory.

Re: I set all 376 Vim options and I'm still a fool

#106

Earlier quoted context omitted.

I found that moving between empty lines is the nicest way to navigate most code across all programming languages, markup languages and just regular text. I don’t have to think, I don’t have to count, I just move and select text big chunks at a time… (not in vim, but I first saw someone have key bindings for this in vim)

https://vimhelp.org/motion.txt.html#%7B { [count] paragraphs backward. exclusive motion. } [count] paragraphs forward. exclusive motion.

What does exclusive motion mean here?

Re: I set all 376 Vim options and I'm still a fool

#107
post #73

Earlier quoted context omitted.

Generally I'm using 'e' to go forward and 'b' to go backward

Whereas I have always used `w` and did not even know that `e` existed (not that I can see an obvious advantage to it). Ahh, vim.

More often than not you want 'de' or 'ye' rather than 'dw' or 'yw'

Re: I set all 376 Vim options and I'm still a fool

#108
I was lucky enough that my first employer ran the very first 4.2BSD in Denmark outside academia (on a DEC-VAX/750), so i grew up with Bill Joy's newfangled "vi" and spent countless hours recap'ing the cheat sheet.

To this day stuff like "3dw" and "d}{{[P" are just second nature. Very much enjoying moders stuff like neovim and CoC/LSP too.

And yes, nvim is perferctly suitable for Java and maven with ctags/ripgrep/fzf etc. plugins

Re: I set all 376 Vim options and I'm still a fool

#109

> The feeling of true Vim fluency—one where every keystroke is exact, I never make mistakes, and I’m exploiting every obscure feature—is a fantasy, at least for me. Perfection is not particularly attainable, or necessarily the point. Nor would it be that fun, I think? It's nice to have some aspect to improve upon. See this Casals quote: > A reporter asked Casals, "You are 95 and the greatest cellist that ever lived.…

Hokusai wrote at the age of 75 that he would only begin to understand the structure of living beings at 100, and hoped to “reach perfection at 110.” He died at 89.

Re: I set all 376 Vim options and I'm still a fool

#110

I never understood this idea that you should min/max your typing. The editor should serve you, not the other way around. Then again, I'm an emacs user.

Another Emacs user here. I would argue that even Emacs is a bit of a struggle sometimes. More modern editors like Sublime Text, Kate, or even Notepad have an advantage of being intuitive. Typing on a letter always outputs that exact letter. The shift key does one thing and one thing only. Mouse integration allows for rather precise cursor placement in a way that utilizes a human's natural hand-eye coordination. The shortcuts that they do use are common across the OS (no need to remember if the copy you need is Ctrl+A - W, Ctrl+W, Ctrl+Shift+C, or Ctrl+C).

Part of the issue is that operating systems have gotten more advanced and more standardized since Vi and Emacs were originally built. However, there is the case that UI designers have learned a lot over the decades. I like Emacs as well, especially when I am doing sysadmin work. However, I have to admit that it is not always intuitive. And even Emacs is more intuitive compared to the modal-nature of Vi.

Post reply on HN