Live data from Hacker News

Learn Vim (2021)

github.com

121–130 of 215 posts

Re: Learn Vim (2021)

#121
Great to see a vim tutorial that has buffers as one of the very first topics! In many vim tutorials you wade through hours of moving/editing ("This is how you delete a word.", "This is how you delete two words", ...) before you finally get to the most basic UI elements.

The author also quickly introduces helpful concepts like :h, .vimrc without going into too much detail up front.

From the first chapters this seems to be well structured according to what you need to know when learning not according to some natural structure of the topic as perceived by someone who is an expert already.

Re: Learn Vim (2021)

#122

I can handle basic editing in vim and I have given real tries to use it as my main text editor but I just cannot find a way to get as comfortable in vim as I can in VS Code.

I hated all the configuration stuff to get a usable vim ide. VS Code and its plugins Just Work™ for ide stuff with almost no setup so it was a lot easier for me to just use vs code with vim bindings than to get a good vim setup. Plus I can fall back on visual editing a lot easier this way if I forget some esoteric vim functionality and have to click through a menu.

Re: Learn Vim (2021)

#123
post #115
post #78

Earlier quoted context omitted.

I feel like at a certain point of efficiency there are diminishing returns. A good analogy is typing speed. You don't need to have 200 wpm to be productive. Everybody adapts to how efficient they need to be at what they do. Vim is not a requirement for being productive. If it was, it would be the most popular editor. I also don't think the person you are replying to is saying that it isn't important to "master" your…

You don't need to hit 200 wpm but I haven't seen too many programmers who hunt-and-pecks at the keyboard and can't touch type. Even on a Qwerty keyboard you should be able to get high double digits, if not hit/exceed 100 wpm. The two sites I like for practice are: https://monkeytype.com/ https://play.typeracer.com/

Typing fast for sport is fun, that I understand. But it's really weird (to me at least) how most developers say that measuring lines of code as a performance metric is an awful idea, and then there are others that more or less kinda shame people for not being good or great typists.

Am I crazy? Isn't it conflicting? Maybe those two groups don't overlap at all? Then do great typists believe measuring lines of code to be a good idea?

And being proficient at using your code editor doesn't require or exclude being fast at typing. Between the two I personally would chose mastery of vim/emacs or some other IDE over having a typing speed faster than 80 WPM. Sure, both would be great, but if I have to choose one I know which I prefer.

Full disclosure: I type on a QWERTY layout at an average of 65 WPM.

One thing I'd add is that some stuff like Home Row Mods, Caps Lock as ESC and enhancements like that seem to me like a larger productivity booster than the jump from 70 WPM to 100 WPM. But even so I might be wrong on that because I personally haven't experienced writing faster than 70 something WPM at my best.

Anyway, rant over and I apologize if I come off as rough. It's just something that's been nagging at the back of my mind and I still don't know how to properly put it into words.

Re: Learn Vim (2021)

#124
post #115
post #78

Earlier quoted context omitted.

I feel like at a certain point of efficiency there are diminishing returns. A good analogy is typing speed. You don't need to have 200 wpm to be productive. Everybody adapts to how efficient they need to be at what they do. Vim is not a requirement for being productive. If it was, it would be the most popular editor. I also don't think the person you are replying to is saying that it isn't important to "master" your…

You don't need to hit 200 wpm but I haven't seen too many programmers who hunt-and-pecks at the keyboard and can't touch type. Even on a Qwerty keyboard you should be able to get high double digits, if not hit/exceed 100 wpm. The two sites I like for practice are: https://monkeytype.com/ https://play.typeracer.com/

Also shoutout to https://www.keybr.com

I used this to learn one hand typing when I was bored.

Re: Learn Vim (2021)

#125

I'm using vim for 10 years and I know I have a lot of "bad" habits that I'm trying to eliminate, but it's hard. For example: 1. instead of doing 4j I might do jjjj 2. if I'm in the middle of a word and want to change it, I'll do bcw instead if ciw 3. if I want to copy 3 lines, I'll do Shift-V+jjj+ESC, instead of just 3yy 4. (possibly other 100 items here...) But I find it very hard to change those habits. Anyone else…

I don't think those are "bad" habits, to me it seems like you've already found your own way of using your editor.

You seem aware that there's an alternative way of doing the things you want, and seems like you've tried doing things the alternative way, but it "doesn't stick" with you.

You don't really have to start using the most absolutely 100% optimal way of achieving something in the least amount of keystrokes (unless that's actually your goal). As long as your editor doesn't get in the way, I consider it a win already.

So I don't think you're "losing" anything. If the alternative way really was something that actually benefited you, you'd have probably picked it up by now if you actually considered it better than your current habits.

For example:

> 1. instead of doing 4j I might do jjjj

> 2. if I'm in the middle of a word and want to change it, I'll do bcw instead if ciw

> 3. if I want to copy 3 lines, I'll do Shift-V+jjj+ESC, instead of just 3yy

If you want to copy all the body of a 100+ line function, I bet you probably do something like `Vi{Y` (or similar), even if it slows you down a little, because you know the slight pause is still better compared to mashing the `j` key 100 times.

Yes, you can probably do it like `yi{`, but the difference doesn't matter (especially once one of them is in muscle memory), and it's just preference.

Even something like `V50j50jjjj` for 103 lines (with the "50" being picked arbitrarily) is already a win.

Re: Learn Vim (2021)

#126
post #115

Earlier quoted context omitted.

You don't need to hit 200 wpm but I haven't seen too many programmers who hunt-and-pecks at the keyboard and can't touch type. Even on a Qwerty keyboard you should be able to get high double digits, if not hit/exceed 100 wpm. The two sites I like for practice are: https://monkeytype.com/ https://play.typeracer.com/

Typing fast for sport is fun, that I understand. But it's really weird (to me at least) how most developers say that measuring lines of code as a performance metric is an awful idea, and then there are others that more or less kinda shame people for not being good or great typists. Am I crazy? Isn't it conflicting? Maybe those two groups don't overlap at all? Then do great typists believe measuring lines of code to b…

I don't see how they are related at all! Even the worst programmer can see that if we were to judge by LoC that they could add frivolous lines to juke the stats. LoC is stupid and I don't see how LoC is relevant to the conversation at hand. I do think that every programmer's had that stroke of inspiration where they can't type fast enough to get the code out of their head though

As far as typing speed, the difference between 10 wpm and 40 wpm is far greater than 70 wpm and 100 wpm. You don't have to hit 100 wpm to be a good programmer, but I have a hard time believing you can be one hunting and pecking at 10 wpm. (With exception made for the blind.)

Re: Learn Vim (2021)

#127
post #40
post #32

Earlier quoted context omitted.

What’s the selling point of helix then? Personally I have one hell of a config, but since you’re fine with vscode defaults, the only thing I’ve really done to vim that counts was cloning ale into a specific vimfiles directory. What was your package set?

The selling point is that it's a solid editor with zero config I can use in the terminal for those "in between" tasks where it's not really worth pulling it up in an IDE but worth having some syntax highlighting and LSP support. Think like, I need to make a quick change to a python script in some far flung directory. In/out in less than a minute. Just the fact that you're asking what my package set was is a turnoff f…

I agree with you, it would be nice to have a cloud profile, a plugin store, few other “windowing” features.

But by package set I literally mean it, e.g. mine is ale, nerdtree, snipmate, and the rest is cosmetic: scss syntax, tab guides and a couple of other syntaxes. Not some lunar/astro nvim-based heap of packages.

What I really miss in vscode and others, be it zeroconf or not, is editor programming features. E.g. I like to have sections in code that I can easily navigate. Something nmap ; /\/\/sec_$ does that. I also can create a popup with all of them + function names grepped from an unsaved source and navigate. Or highlight few more tokens. That is impossible in vscode unless you take a deep dive into its or its modules not very well documented internals. You can’t even write a module in .vscoderc, it must be formed into a package and [re]installed or get run in a special vscode mode. If the store doesn’t have what I want, I’m out of luck.

Things that failed (various degrees) for me: correct linewise indentation, readable sections on outline or minimap, non-syntactic folds, custom command mappings. Also the defaults are horrible, my last attempt was something like three pages of settings.json. Way too many afternoons, deleted my whole account to never try again. Tbf, my vimrc is also two pages long in the part that is related to settings. But at least the rest does what I want.

Re: Learn Vim (2021)

#128
post #3

I love Vim, it's just a shame it takes 200 years to setup properly.

Setup how? I've used vi/vim daily as my main editor for the past 35 years or so, over that time I doubt I've put more than 20 total hours into its setup. I've been using some evolution of the same .vimrc for decades and it's only accumulated a couple dozen lines. The longest setup task I can remember was a few years ago getting MacVim to launch with one window per folder (with files as tabs, in most cases that equate…

20 hours???

Your comment makes it sound like you think it's a small amount? I get that it's over 35 years, but still!

Re: Learn Vim (2021)

#129

I dunno, I never sat down to learn vim, just used it every day for a couple years. I’m not one of those wizards who is, like, answering stack overflow questions or writing wiki articles, but I get the job done. Is it necessary to learn Vim? Seems like a chore. Is the text editor really a bottleneck for anyone? I find that no matter how slow I type, I need to spend more time thinking of what to type anyway, if I’m doi…

Bottleneck, yes but who cares. Your code or work won't be any better.

It just removes a lot of frustration, that's the thing for me. Working less on fiddling with text is focusing more on the conceptual level. Again, I'm not claiming the output is better, I'm just happier doing it.

Re: Learn Vim (2021)

#130

I'm using vim for 10 years and I know I have a lot of "bad" habits that I'm trying to eliminate, but it's hard. For example: 1. instead of doing 4j I might do jjjj 2. if I'm in the middle of a word and want to change it, I'll do bcw instead if ciw 3. if I want to copy 3 lines, I'll do Shift-V+jjj+ESC, instead of just 3yy 4. (possibly other 100 items here...) But I find it very hard to change those habits. Anyone else…

1. is not bad, continuous visual feedback is awesome and more ergonomic that switching to a "counting" mental mode, especially for shorter distances (of which 4 is a part) 3. similarly, it's just a deficiency in vim that 3yy is invisible, so using a command that provides visual feedback is superior. Maybe try to fit a Shift-V to a non-modifier keybind, and depending on how ESC is convenient, a better exit would also be nice
Post reply on HN