I really have my problems, to wrap my head around "hjkl", as there is (imho) no logical mnemonic for the directions. It is sadly just "learn by rote".
I really have my problems, to wrap my head around "hjkl", as there is (imho) no logical mnemonic for the directions. It is sadly just "learn by rote".
" Disable arrow keys
noremap <Up> <nop>
noremap <Down> <nop>
noremap <Left> <nop>
noremap <Right> <nop>
You'll have one or two frustrating days, but after that your muscle memory will take care of remembering "hjkl" for you.But non the less, the logic didn't register with me. (something like clockwise/counter-clockwise, or anything remotely recognizable ;-) )
I also disabled Home, End, PgUp and PgDown:
noremap <home> <nop>
noremap <end> <nop>
noremap <pageup> <nop>
noremap <pagedown> <nop>I used that arrangement back in the 1980s myself, but when keyboards evolved, so did I. I remapped the movement keys to match the other movement keys (arrowkeys).
If you're going to go to the effort of customizing your vim to force yourself to learn a new keyboard arrangement, customize it so that the movement keys are ijkl instead of hjkl, so that both of your sets of arrowkeys are in the same, natural, modern, inverted-T arrangement. Then you don't have to deactivate those real arrowkeys, because there won't be any temptation to use them with the ijkl keys in the same arrangement and easier to reach.
"Oh, no!" people half my age will shriek. "Then what happens to the 'i' key? This would be impossible." Just use the now-unused key on the left ('h') for your insert-on-left. Reach left to insert on left. There, easy.
Funny how those who insist that YOU should relearn something as fundamental as the entire inverted-T arrowkey structure built into the hardware of every keyboard and used by almost all apps on all platforms including kids' game boxes find relearning a single, arbitrary 'i' key such an insurmountable obstacle to themselves.
But what if you have to use a copy of vim on a machine without your customized .vimrc? Sorry, but that's just an argument against ANY useful customization of vim. It's just not a problem, because the real arrowkeys on the keyboard are in the arrangement you're used to using on the ijkl keys. Just use the real arrowkeys temporarily or copy over your .vimrc. I've done it for years.
But what about other editors that have a vi mode? What about something like zsh with a vi mode? These things can be remapped to match your .vimrc unless they only offer a couple of keys, in which case they can be treated just like all apps with their own couple of local keyboard shortcuts.
Really, if the standard advice is, "You'll have one or two frustrating days, but after that your muscle memory will take care of remembering "hjkl" for you," then you can take your own advice and keep the inverted-T muscle memory you already have for the movement keys and reduce your task to learning a single 'h' key for insertion, and save the next generation from this nonsense.
If a 30-yr user of vi like me isn't stuck with the historical accidents of the past, why should new users have to be?
I've never got into the habit of using anything other than arrow keys even though I've been an occasional vi user for 26 years. Indeed the ancient model of TeleVideo terminal I first learnt Unix on had arrow keys - although not in an inverted-T:
The reason for doing this is, for me, simply that it is on the home row, and therefore I can reach it quicker. If you like 'ijkl', fine, do that. I feel more comfortably with 'hjkl'.
Or rather, what I am actually using is 'dhtn', being a Dvorak user. And my delete is on 'e'. Because that is how I like it.
Use whatever you like, but in any case switching from one variant to another (for whatever reason) will take a few days of retraining the muscle memory.
No, instead, they advise all new users that they should force themselves. Why are new vim users so often advised to deactivate their arrowkeys? Apparently the arrowkeys tempt them to take their hands off the normal keys. Why are they so tempted to do something so awkward? Because to new vim users with a lifetime of experience with inverted-T arrangements, the weird, archaic hjkl arrangement is even more awkward. "Well," they're told, "the solution is to make your arrowkeys YET MORE awkward by deactivating them entirely."
What I'm saying is that the significant vim benefits that come from staying on the normal keys can be obtained with a carrot instead of a stick. Instead of making their arrowkeys even more difficult than the awkward hjkl keys, make their normal keys even more tempting.
When I started out using Vim someone teaching me the basics pointed out the 'hjkl' navigation and recommended that I learn it, because I will be faster with it. Having to learn a lot of other commands, I kind of ignored the advice since it was simply a reflex for me to reach for the arrow keys. I happily used the arrow keys for years; nobody complained about it. At some point I finally decided to give the 'hjkl' navigation a serious try, and for that reason deactivated the arrow keys to help me break my old habit and take up the new one.
I would have found taking up 'ijkl' equally awkward, since either case I would have to retrain my muscle memory. Honestly, 'ijkl' and 'hjkl' doesn't seem to make much of a difference to me. Either one has to be trained a bit, and then it's automatic.
The one advantage of 'ijkl' that I see is that it forms a basis for the quaternions :-).
Because it may make you slightly slower for a week, but it makes you faster for the rest of your life.
Depending on how much time you think you'll spend in Vim for the rest of your life, that tradeoff may be very smart indeed.
Doing what seems easiest or most "natural" at first may not always be the best user interface in the long run.
The only people that would benefit are people who have not yet learned hjkl, and those people have no influence. What are you expecting to be done, Vim wildly breaks standards, pisses off existing users, and changes the default key layout? Never going to happen, never should happen. First off, because it will piss off existing users for no reason whatsoever, and secondly because nobody in a position to make that call would make that call. Thankfully.
Distribute Vim yourself with these changes; see how far you get.
Having navigation on 'hjkl' for me was never about a lack of arrow keys, and has always been about convenience. The reason it's specific to Vi/m is that you need a modal editor to be able to pull it off.
Then in addition to that ijkl is more logical than hjkl.
This comment thread is kind of blowing my mind, how can so many people have an issue with this? It's such a tiny simple thing to put into muscle memory. Are you guys all hunt and peck typers?
I feel a little bad for being insulting, but it really is hard to imagine so much resistance to memorizing j=down, k=up.
The hjkl pattern is the same pattern as the arrows at the top of dance dance revolution and people seem to pick that up pretty quickly.
It's not that it's hard to memorize: Emacs' 'p' for up and 'n' aren't hard to memorize. They're just utterly dumb. Just like 'jk'.
You're not sounding insulting: you're sounding like someone who has never put any thought into that issue arguing vs someone who did.
I'm an Emacs user and yet it's 'ijkl' for me (it's Emacs heresy of course).
Now I don't doubt that dance dance revolution players are representative of professional programmers... But lots of gamers (eg professional first-person shooter players) do use the inverted T arrow principle to quickly move up/down/right/left -- typically WASD and sometimes ESDF.
It simply makes more sense to "train your muscle memory" to something that also logically makes a lot of sense. You know, like... Up to go up. Down to go down. Left to go left. Right to go right.
Arrow keys for movement, letter keys for input (what a novelty?!), and a working mouse. All available since MS Dos 6 or earlier.
I understand that some people like VIM and or Emacs, but why must UNIX people force such arcane editors down people's throats? Edit.com put them to shame almost twenty years ago.
Yes, I know, if you spend YEARS learning clever key combinations you can be ever so slightly more efficient, what a novelty...
Non-modal (I consider Emacs modal too) non-programmable editors are toys.
I'm surprised you didn't mention it.
(nice rant though!)
And he did realize that it's easier, from the home position of a touch-typist, to hit 'i' than it is to stretch your index finger and hit 'h'. Just ing try it and you'll see.
In addition to that, it's also more logical to have the inverted 'T' arrow.
Have you considered the possibility that you find what you're using a "significant advantage" simply because it is the same as what an old arcane keyboard did use back in the days?
I'm going to try your suggestion though, it makes sense.
more importantly though, is you should almost never use hjkl in the first place. these are the commands you should be using:
b B w W e E ge gE
H M L I A $ ^ 0 %
{ } [[ ]] [] ][
t<char> T<char> f<char> F<char> ; ,
/<chars>
(search counts as a movement command,
d/foo<enter> will delete everything to foo)
probably the commands i use the most are w b and { }I'm on Emacs but... I'm doing exactly like you. Inverted 'T' arrows on 'ijkl' ("jkl" being, for a touch typist, the default position for already three of four fingers of the right hand).
It makes sense: pro-gamers for example (not programmers but 'pro-gamers') do often use 'wasd' or 'esdf' because most are right-handed, so they use the mouse with their right hand and they use an inverted 'T' arrows on their left hand (both 'wasd' and 'esdf' do work... I preferred 'esdf' backed when I used to game but that was a long time ago).
'ijkl' makes no sense besides for historical reasons.
Let's not talk about Emacs (and I love Emacs) 's totally stupid 'pbnf': that has to be one of the dumbest way ever way to move the cursor.
Yet people would rather catch RSI than take the time it takes to configure their Emacs to use 'ijkl' instead of 'pbnf' (Previous / Backward / Next / Forward... Zomg. They really did this).
Emacs has a lot of other stupid problems too: I saw some people were remapping the totally Control+x (which you need all the time) to other things using ctl-x-map. I'll look into that next.
And I agree with you: it doesn't take long to get use to a logical way of moving your cursor.
Oh well. We won't convince anyone but... At least both vim and Emacs (and probably many others) are configurable so at least the ones who put thoughts into that matter are able to modify their environment to use a saner configuration.
The only time I use an inverted-T is when playing games that use wasd and it really doesn't make sense there, to the extent that when I used to be really into Q3A I started using asdf. (asdf, unlike hjlk, has unfortunately not stayed in my muscle memory.)
The importance of any sort of t-shape is only clear to me if the user cannot type.
Contracting fingers to slide between up and down keys is a lot easier than sliding them sideways.
I use whatever my hand happens to be closer to. 85% of the time that's the home row, hjkl. But if my hand is closer to the arrow keys I'll use that, and if my hand is on the mouse I'll use that.
" Arrow keys set up for easy buffer switching
nnoremap <left> :bprev<cr>
nnoremap <right> :bnext<cr>
nnoremap <down> :buffer #<cr>
nnoremap <up> :buffers<cr>:buffer<space>Remapping the movement keys in Worms Reloaded also helped massively, though did result in me getting completely thrashed for the first twenty or thirty matches I played.
http://jwvideo.free.fr/ImagesMac/AppleII/Apple%20II%20int%C3...
I've always thought that was so much better than the inverted T on PC keyboards, since you can press all the keys without moving your fingers - much faster for games.
Once you have integrated them in your workflow, you'll wonder why you even got into the trouble to force yourself to use hjkl instead of the arrows.
"hjkl", as there is (imho) no logical mnemonic for the directions.
left: "h" is leftmost in the groupright: "l" is rightmost in the group
down: "j" extends down below the baseline
up: "k" extends up to the topline
These four keys are the most basic thing about vim. Yes there doesn't seem to be much to remember them by, but for these at least, there doesn't need to be. Just muscle through it as long as it takes. It won't take long if you're using vim regularly. Soon you won't think about it, you'll just think "up" and you'll be up a line without consciously thinking "... um ... k".
There are ways to get around these four: arrow keys, macros, whatever. Don't. Just learn them.
Bonus, those keys show up in other vim-like command interfaces, including bash and other shell command line shortcuts. And if you use .inputrc, they'll show up in database and language repls and similar environments.
Just learn them.
Display a big arrow, grab an input, make a nice boop noise if it's right and a nasty beep noise (with a graphic flash) if it's wrong. Keep score of how many key presses were right, and average time for each press.
· Control-H is Back Space: it moves the cursor one position left.
· Control-J is Line Feed: it moves the cursor one line down.
The other two seem to be arbitrary on the part of the ADM-3A designers, and having Control-L (Form Feed) perform cursor-right rather than clear-screen seems a bit dubious, but given their constraints and the desire to keep all the motions together, it's hard to argue for any different choices.
Oh, this `j` key has an inset to distinguish it from the rest. Surely this means I need to press this one!
(You can easily figure out the three other keys from there).
H & L are left & right - fairly intuitive, leftmost is left, rightmost is right
J looks kinda like a down arrow
That leaves K, which must be up by process of elimination :)
h: move left ctrl-h (which is backspace in ASCII): move left a space while doing something
j: move down ctrl-j (line feed): move down a space while doing something
Unfortunately, this doesn't extend to k (vertical tab) or l (form feed), but... maybe it's helpful?
If you need to practice, play robots or nethack...
Nowadays I don't even need to think about using any of those keys for moving around. In fact, I use them in pretty much every application that supports them, including Firefox (with pentadactyl) and less.
(I started to write "and my middle finger (on K) is pointing up", but then I realize that an upward-pointing middle finger means something entirely different.. <:)