vim-mnemonics for hjkl.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

vim-mnemonics for hjkl.

Hongyi Zhao

I noticed the following mnemonics for vim shortcut keys from <https://gist.github.com/iambrj/1e4de522ef5dcf13f530bb4b58cd9b32>:

<quote>

h: left

j: down

k: up

l: right

</quote>

But I still can't figure out the correspondence between their literal representation and the operations of them. Any hints will be highly appreciated.


Regards,

HY

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/63ef0acb-5e0d-403e-8f29-b57c2c10e729n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: vim-mnemonics for hjkl.

Marius Gedminas
On Tue, Mar 02, 2021 at 02:14:29AM -0800, [hidden email] wrote:

> I noticed the following mnemonics for vim shortcut keys from <https://
> gist.github.com/iambrj/1e4de522ef5dcf13f530bb4b58cd9b32>:
>
> <quote>
>
> h: left
>
> j: down
>
> k: up
>
> l: right
>
> </quote>
>
> But I still can't figure out the correspondence between their literal
> representation and the operations of them. Any hints will be highly
> appreciated.
Take a look at the keyboard layout picture at
https://en.wikipedia.org/wiki/ADM-3A#Hardware
That's the machine on which the Vi editor was created.

(Disappointingly there's no actual photo on Wikipedia, but you can find
those on Google Images.)

On today's machines (using QWERTY layouts) I find it easiest to remember
that h is all the way on the left, j extends down below the baseline, k
extends up beyond the x-height of small letters, and l is all the way on
the right.

Marius Gedminas
--
There is nothing more practical than a good theory.
        -- James Clerk Maxwell

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20210302103101.rvsz3hfj5p2awff2%40blynas.

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: vim-mnemonics for hjkl.

tuxic
In reply to this post by Hongyi Zhao
Hi,

that's of a complicated way easy... ;)

on the keyboard the keys are ordered as follows:


H       J       K       L
left                    right

ok...and J looks a tiny little bit like an arrow downward.

So conclusion is: K must be upward.

HAVE FUN!
Cheers!
mcc



On 03/02 02:14, [hidden email] wrote:

>
>
> I noticed the following mnemonics for vim shortcut keys from
> <https://gist.github.com/iambrj/1e4de522ef5dcf13f530bb4b58cd9b32>:
>
> <quote>
>
> h: left
>
> j: down
>
> k: up
>
> l: right
>
> </quote>
>
> But I still can't figure out the correspondence between their literal
> representation and the operations of them. Any hints will be highly
> appreciated.
>
>
> Regards,
>
> HY
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/63ef0acb-5e0d-403e-8f29-b57c2c10e729n%40googlegroups.com.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20210302103747.fwfk7buf5po6glrt%40solfire.
Reply | Threaded
Open this post in threaded view
|

Re: vim-mnemonics for hjkl.

Steve Litt
In reply to this post by Hongyi Zhao

On Tue, 2 Mar 2021 02:14:29 -0800 (PST)
"[hidden email]" <[hidden email]> wrote:

> I noticed the following mnemonics for vim shortcut keys from
> <https://gist.github.com/iambrj/1e4de522ef5dcf13f530bb4b58cd9b32>:
>
> <quote>
>
> h: left
>
> j: down
>
> k: up
>
> l: right
>
> </quote>
>
> But I still can't figure out the correspondence between their literal
> representation and the operations of them. Any hints will be highly
> appreciated.

I think it's mostly a matter of ease. It's all done from touch typist
home position, with one hand. Back then there was no mouse, so they
chose the right hand, dominant on the majority of people, as that hand.
I'd guess if mice had existed universally when vi was created, the
cursor keys would have been done by the left hand so the user could
keep his or her right hand on the mouse.

I think the mnemonics were in the fingers, not in the brain.

SteveT

Steve Litt
Autumn 2020 featured book: Thriving in Tough Times
http://www.troubleshooters.com/thrive

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20210302060750.79bf122b%40mydesk.domain.cxm.
Reply | Threaded
Open this post in threaded view
|

Re: vim-mnemonics for hjkl.

Niels Kobschaetzki


Schöne Grüße

Niels

> On 2. Mar 2021, at 12:08, Steve Litt <[hidden email]> wrote:
>
> 
>> On Tue, 2 Mar 2021 02:14:29 -0800 (PST)
>> "[hidden email]" <[hidden email]> wrote:
>>
>> I noticed the following mnemonics for vim shortcut keys from
>> <https://gist.github.com/iambrj/1e4de522ef5dcf13f530bb4b58cd9b32>:
>>
>> <quote>
>>
>> h: left
>>
>> j: down
>>
>> k: up
>>
>> l: right
>>
>> </quote>
>>
>> But I still can't figure out the correspondence between their literal
>> representation and the operations of them. Any hints will be highly
>> appreciated.
>
> I think it's mostly a matter of ease. It's all done from touch typist
> home position, with one hand. Back then there was no mouse, so they
> chose the right hand, dominant on the majority of people, as that hand.
> I'd guess if mice had existed universally when vi was created, the
> cursor keys would have been done by the left hand so the user could
> keep his or her right hand on the mouse.
>
> I think the mnemonics were in the fingers, not in the brain.
Iirc the keyboard the original was developed in had even arrow-symbols in hjkl
It is more about the original keyboard than mnemonics or touch typing I think. Same reason for Escape to switch between modes which was on that keyboard where caps lock is today.

Niels

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/939A4317-B2EF-4128-82F2-5D1342C15582%40kobschaetzki.net.

smime.p7s (3K) Download Attachment
JB
Reply | Threaded
Open this post in threaded view
|

Re: vim-mnemonics for hjkl.

JB
In reply to this post by Hongyi Zhao
The mnemonic I used for J and K when I first started was J[ump] and K[ite]. H is on the left and L is on the right as pointed out by another user.


Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, March 2, 2021 2:14 AM, [hidden email] <[hidden email]> wrote:

I noticed the following mnemonics for vim shortcut keys from <https://gist.github.com/iambrj/1e4de522ef5dcf13f530bb4b58cd9b32>:

<quote>

h: left

j: down

k: up

l: right

</quote>



But I still can't figure out the correspondence between their literal representation and the operations of them. Any hints will be highly appreciated.


Regards,

HY


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/sZxgpaye1S78aaQUBFWBoHQi2qzFyL3JwIeBZ5lsUW3uJdp4NL1uyvrsZni-6BAx_OEK0gw03k2Gp19o3EU9ReHA6mi6kGkOYxbIadOpYWM%3D%40protonmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: vim-mnemonics for hjkl.

Tony Mechelynck
On Tue, Mar 2, 2021 at 11:12 PM 'JB' via vim_use
<[hidden email]> wrote:

>
> The mnemonic I used for J and K when I first started was J[ump] and K[ite]. H is on the left and L is on the right as pointed out by another user.
>
>
> Sent with ProtonMail Secure Email.
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Tuesday, March 2, 2021 2:14 AM, [hidden email] <[hidden email]> wrote:
>
> I noticed the following mnemonics for vim shortcut keys from <https://gist.github.com/iambrj/1e4de522ef5dcf13f530bb4b58cd9b32>:
>
> <quote>
>
> h: left
>
> j: down
>
> k: up
>
> l: right
>
> </quote>
>
>
>
> But I still can't figure out the correspondence between their literal representation and the operations of them. Any hints will be highly appreciated.
>
>
> Regards,
>
> HY

As others pointed out, whatever memory trick works for you, use it.
With the h j k l keys near the middle of the most used Latin keyboard
layouts, not only QWERTY but also AZERTY and QWERTZ, h is the leftmost
of them and l the rightmost. For the other two, what I use is this:
lowercase j has a downward-pointing tail and lowercase k has an
upward-pointing one.

Also, now that all keyboards have arrow keys, Vim supports them; but
this means that in Normal mode, j and ↓, k and ↑ are synonymous. I
defined the following mappings to have ↓ and ↑ move by screen lines
while j and k move by file lines (which is different when 'wrap' is
on):

" move by screen lines with ↑ ↓, by file lines (Vim default) with k j
" but not in Insert mode, where hjkl insert a letter
:map <Up> gk
:map <Down> gj

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXutm-3849YD-mRG8xpd2F1B_wR31M0dDisHX8oJohZTmw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: vim-mnemonics for hjkl.

Csaba Hoch
In reply to this post by Hongyi Zhao
Some years ago I read a mnemonic from the perspective of Japan:

                Kamchatka
                    ^
                    |
    Hong Kong  <----o -----> Los Angeles
                    |
                    V
                Java/Jakarta

Maybe not all four place names were exactly these.

I thought I read it in the Vim documentation, but I cannot find it either there or on the web.

Csaba

On Tuesday, March 2, 2021 at 11:14:29 AM UTC+1 [hidden email] wrote:

I noticed the following mnemonics for vim shortcut keys from <https://gist.github.com/iambrj/1e4de522ef5dcf13f530bb4b58cd9b32>:

<quote>

h: left

j: down

k: up

l: right

</quote>

But I still can't figure out the correspondence between their literal representation and the operations of them. Any hints will be highly appreciated.


Regards,

HY

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ac4b916d-d864-4c2b-a932-eccb63c00cbdn%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: vim-mnemonics for hjkl.

Eli the Bearded
Csaba Hoch wrote:
> Some years ago I read a mnemonic from the perspective of Japan:
>
>                 Kamchatka
>                     ^
>                     |
>     Hong Kong  <----o -----> Los Angeles
>                     |
>                     V
>                 Java/Jakarta

That is the funniest memory trick for that I've ever seen.

> Maybe not all four place names were exactly these.
>
> I thought I read it in the Vim documentation, but I cannot find it either
> there or on the web.

I have never seen any use-a-world-map mnemonic tricks for vi / vim
before. It really is very where-you-are centric. For me, Jakarta and
Hong Kong are roughly the same direction, and Los Angeles is south.
Kamchatka is very much north-west instead of north. I could substitute
Klondike, Alaska, and Jalisco, Mexico for north / south. Maybe Lithuania
for east. Hong Kong works fine for west, even though it is really
south-west.

Elijah

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/4Drzhr6Z0czfYm%40panix5.panix.com.
Reply | Threaded
Open this post in threaded view
|

Re: vim-mnemonics for hjkl.

JohannS-2
In reply to this post by Hongyi Zhao
On Tue, Mar 02, 2021 at 02:14:29AM -0800, [hidden email] wrote:

>
>
>I noticed the following mnemonics for vim shortcut keys from
><https://gist.github.com/iambrj/1e4de522ef5dcf13f530bb4b58cd9b32>:
>
><quote>
>
>h: left
>
>j: down
>
>k: up
>
>l: right
>
></quote>
>
>But I still can't figure out the correspondence between their literal
>representation and the operations of them. Any hints will be highly
>appreciated.

The big advantage of hjkl navigation is that it leverages
the home keys for touch typing on a QWERTY keyboard for
what is for many people the dominant right hand.  Under
this system and with right hand at the home key positions:

index finger (j)umps down,
middle finger (k)limbs ups,
slide index finger left and (h)urtle left--(h) hangs near (j),
ringer finger to (l)eft of middle finger (l)urches left

Others have already said that "j" looks a bit like an
arrow down symbol, so I used to use this to remind myself
when it was new to me.

Honestly for me, the big reason I learned to rely on hjkl
navigation, had naught to do with being an old-timer
before marked arrow keys and everything to do with playing
Roguelike games such as Angband and UMoria using the
roguelike key command set:
https://rephial.org/help/playing
In such games the arrow keys work, but it saves time not
needing to reach for the arrow keys then hunt and peck for
the letter keys.  Essentially, this is the same reason to
use hjkl navigation for text editing.

There is certain elegance to being able to call legacy
game play "training" with a modicum of seriousness. :)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20210304211735.GB5562%40linux.site.