3 ms·
> Also, a lot of beginners are perplexed why vi uses "hjkl" keys for cursor movement. I really don't understand why people get hung up on this. Vim supports ar
by tinalumfoil 5y ago
> Also, a lot of beginners are perplexed why vi uses "hjkl" keys for cursor movement.
I really don't understand why people get hung up on this. Vim supports arrow keys. hjkl are convenient alternatives but if you're at the point of not being comfortable switching between normal and insert mode just use the arrow keys. Insisting othereise is insisting you learn everything at once, which is demotivating and unnecessary.
Arrow keys are more versatile too. They do the behavior you expect in pretty much any mode.
- agentwiggles 5y agoI knew a vim-evangelist developer once who added bindings to his .vimrc file so that, if you pressed an arrow key in insert mode, it would insert the appropriate arrow symbol. I think this was meant to train the user _not_ to use the arrow keys to navigate around, but rather to switch to normal mode and use hjkl or other movement commands. While I don't approve of this on a practical level, I have to admit that I find the logic of the joke hilarious. You were in insert mode, and you pressed the arrow key, so it ... inserted an arrow.
- jasode 5y ago>I really don't understand why people get hung up on this. Vim supports arrow keys. hjkl are convenient alternatives [...] Maybe because tutorials like vimtutor and this thread's website immediately blast hjkl finger exercises at the brand new user with no context whatsoever. The student is now wondering why they are pressing a seemingly arbitrary and random alphabet key just to move a cursor around. E.g. vimtutor 1st screen: Now, make sure that your Caps-Lock key is NOT depressed and press the j key enough times to move the cursor so that lesson 1.1 completely fills the screen. E.g. this website's 1st instructions: You can use the h and l keys to move the cursor. For learners that need a little bit of scaffolding in the brain to make sense of what keys to press, a little bit of history about the origins of "hjkl" helps. Also, in my case, I learned classic vi (not vim) on DEC UNIX and the arrow keys did not work. Instead, the arrow keys inserted funny control characters depending the terminal emulation. So people used to be forced into using hjkl.
- vram22 5y agoYes, and because the control characters sometimes included the Esc key, this could even take you out of insert mode willy-nilly, and maybe delete / change some of your text, suddenly.
- sureaboutthis 5y agoIf it takes someone that long to figure out these four commands, I'm not sure they should be a programmer at all.