Wednesday, March 3, 2021

Re: vim-mnemonics for hjkl.

On Tue, Mar 2, 2021 at 11:12 PM 'JB' via vim_use
<vim_use@googlegroups.com> 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, hongy...@gmail.com <hongyi.zhao@gmail.com> 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 vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXutm-3849YD-mRG8xpd2F1B_wR31M0dDisHX8oJohZTmw%40mail.gmail.com.

No comments: