Live data from Hacker News

Learn Vim motions with an ice-cream van

thisismodest.com

41–50 of 53 posts

Re: Learn Vim motions with an ice-cream van

#41

Fun! There are some combinations that don't seem to work though, e.g. "dG" and "dgg" do nothing.

Yeah, that’s on me. Sorry. I’m slowly introducing motions so they currently don’t all work in combination, but it makes sense so I’ll look into it

Re: Learn Vim motions with an ice-cream van

#43

Earlier quoted context omitted.

jkl; are (on QWERTY keyboards). hjkl are not.

Idk, I get what you mean but I'd personally rather not use my pinky finger for navigation, sounds really uncomfortable.

hjkl AND the cursor keys equally suck for moving the cursor because they only move by one line or by one character.

jjjllllljjh is just as bad as . There are much better ways to move around and touch-typists and non-touch-typists would be better off learning them instead of obsessing over hjkl: :help motion.txt.

Re: Learn Vim motions with an ice-cream van

#44
post #4

Yes, hjkl navigation is certainly one of the things that should learn about a vi clone. But are novices well served, in the 2020s, by that being the primary thing that they learn before anything else? This is not a criticism of this WWW site specifically. The VIM doco has the same priorities, teaching hjkl navigation before arrow keys. (So do nvi2 and NeoVIM.) The problem is that the received wisdom, that arrow keys…

I think the reason to use and teach those keys first, is that they can be used in all the motions aswell. The arrow keys can´t and thus do not really make much sense in a vi context.

Re: Learn Vim motions with an ice-cream van

#45
On World 6-3, if i use i.e. d3j to delete the 3 lines it deletes the current line + the 3 below. Vim generally treats commands like that as "do this X times including the current line", so it should delete the current line and the 2 lines below.

Re: Learn Vim motions with an ice-cream van

#48

Neat, but the (presumably AI-generated) provenance of this means it has regrettable gaps and errors: On "There and back", it says par is 6 – it's solvable in 4. On "Rush hour", it describes an invalid motion 'r': "type a number first to repeat a command, e.g. 3j or 4r" It isn't clear why certain motions are being introduced where they aren't relevant, and therefore aren't going to be immediately practised at point of…

Thanks for the feedback, the par is set based on the level, not the absolute best that can be achieved. I added 4r specifically as an example to get across being able to change multiple characters such as XXXX to YYYY. Though I’m aware some keyboards might not be fully compatible yet so I’ll work on adding wider support. EDIT: You’re right, I loosely included r but it’s not technically “motion”

Great game! Minor issue, the ^ isn't working ABNT2 keyboard on Linux (tested in both Chrome and Firefox). We need it in level=1-5.

Re: Learn Vim motions with an ice-cream van

#49
Fun and helpful little game, thank you! I did find the last world to be a big jump in difficulty, I don't know if there's a better way to explain it or if it's just the nature of the material. Incidentally I got 1 over par on both "Record a routine" and "The full routine", do you know what sequences would be most efficient for those levels?

Re: Learn Vim motions with an ice-cream van

#50
post #44
post #4

Yes, hjkl navigation is certainly one of the things that should learn about a vi clone. But are novices well served, in the 2020s, by that being the primary thing that they learn before anything else? This is not a criticism of this WWW site specifically. The VIM doco has the same priorities, teaching hjkl navigation before arrow keys. (So do nvi2 and NeoVIM.) The problem is that the received wisdom, that arrow keys…

I think the reason to use and teach those keys first, is that they can be used in all the motions aswell. The arrow keys can´t and thus do not really make much sense in a vi context.

The arrow keys can be used as motions for operators in VIM. Try them. This is also true for nvi.
Post reply on HN