Dvorak and hjkl

91 views
Skip to first unread message

Michael Wagner

unread,
May 22, 2008, 8:34:06 AM5/22/08
to vim...@googlegroups.com
Hello folks,

I use here a german keyboard with a german dvorak layout. My problem is
that I want to map the motion keys "hjkl". On a german keyboard these 4
keys looks like this: "hdrn". I've used nnoremap and noremap for mapping
these keys. But when I map them like this I don't have the keys for
other things. For example I can't use "dd" for deleting a line. This is
not a big problem, because I mapped this to ",,". But all keystrokes
with CTRL and this 4 keys don't work anymore with my solution. Any hints
for this, because I like these motion keys more than the arrow keys.

TIA Michael

--
Everybody should believe in something...
I believe I'll have another drink.

Tony Mechelynck

unread,
May 22, 2008, 9:26:31 AM5/22/08
to vim...@googlegroups.com
On 22/05/08 14:34, Michael Wagner wrote:
> Hello folks,
>
> I use here a german keyboard with a german dvorak layout. My problem is
> that I want to map the motion keys "hjkl". On a german keyboard these 4
> keys looks like this: "hdrn". I've used nnoremap and noremap for mapping
> these keys. But when I map them like this I don't have the keys for
> other things. For example I can't use "dd" for deleting a line. This is
> not a big problem, because I mapped this to ",,". But all keystrokes
> with CTRL and this 4 keys don't work anymore with my solution. Any hints
> for this, because I like these motion keys more than the arrow keys.
>
> TIA Michael
>

Try the following:

:noremap <F5> h
:noremap <F6> j
:noremap <F7> k
:noremap <F8> l

I suppose the F5 to F8 keys will be next to each other in that order,
regardless of how weirdly apart your current keyboard layout places the
hjkl keys. This way you won't collide with other already used alphabetic
keys.

Best regards,
Tony.
--
We apologise again for the fault in the subtitles. Those responsible for
sacking the people who have just been sacked have been sacked.
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD

Benjamin Fritz

unread,
May 22, 2008, 9:37:19 AM5/22/08
to vim...@googlegroups.com
On 5/22/08, Tony Mechelynck <antoine.m...@gmail.com> wrote:
>
> On 22/05/08 14:34, Michael Wagner wrote:
> > Hello folks,
> >
> > I use here a german keyboard with a german dvorak layout. My problem is
> > that I want to map the motion keys "hjkl". On a german keyboard these 4
> > keys looks like this: "hdrn". I've used nnoremap and noremap for mapping
> > these keys. But when I map them like this I don't have the keys for
> > other things. For example I can't use "dd" for deleting a line. This is
> > not a big problem, because I mapped this to ",,". But all keystrokes
> > with CTRL and this 4 keys don't work anymore with my solution. Any hints
> > for this, because I like these motion keys more than the arrow keys.
> >
> > TIA Michael
> >
>
>
> Try the following:
>
> :noremap <F5> h
> :noremap <F6> j
> :noremap <F7> k
> :noremap <F8> l
>
> I suppose the F5 to F8 keys will be next to each other in that order,
> regardless of how weirdly apart your current keyboard layout places the
> hjkl keys. This way you won't collide with other already used alphabetic
> keys.
>
> Best regards,
> Tony.
>

How bad is movement without a mapping? I personally use the US Dvorak
layout, and although the keys aren't right next to each other, I have
actually found it easier to remember them.

jk are together, and use the left index and middle fingers (so up and
down is one hand).

hl are not together, but h is right index and l is right pinky, so
left and right are one hand, and right is to the right while left is
to the left.

All in all it works pretty well for me...but I'm not familiar with the
German layout.

Tony Mechelynck

unread,
May 22, 2008, 9:58:01 AM5/22/08
to vim...@googlegroups.com

I don't use any kind of Dvorak, I use fr_BE AZERTY layout, where hjkl
are next to each other, right of center, so I cannot make assumptions
about how easy or impractical it is to reach the hjkl keys of a German
"Dvorak" layout. Of course you could also use the arrow keys, at least
on the full-width keyboard of a desktop computer, but it would mean
moving your typing hand to the right.

Best regards,
Tony.
--
No matter how subtle the wizard, a knife in the shoulder blades will
seriously cramp his style.

Michael Wagner

unread,
May 22, 2008, 10:12:01 AM5/22/08
to vim...@googlegroups.com
* Benjamin Fritz <fritzo...@gmail.com> 22.05.2008

> On 5/22/08, Tony Mechelynck <antoine.m...@gmail.com> wrote:

> > :noremap <F5> h
> > :noremap <F6> j
> > :noremap <F7> k
> > :noremap <F8> l
> >
>

> How bad is movement without a mapping? I personally use the US Dvorak
> layout, and although the keys aren't right next to each other, I have
> actually found it easier to remember them.

Hello Benjamin,

at the moment I move inside vim like this. The solution with the F-keys
is the same like with the arrow keys. But you are right, it's better to
remember the new keys for "hjkl" than to map them.

I use the dvorak keyboard since 2 weeks and the 30 years before I worked
with the qwertz layout. That's why I searched for a solution to map the
keys, because these 4 fingers are glued and it's not so easy to uncouple
them ;-)

Thx Michael

--
I don't hate Windows - it runs great under WINE!

Benjamin Fritz

unread,
May 27, 2008, 11:44:51 AM5/27/08
to vim...@googlegroups.com
On 5/22/08, Michael Wagner <michae...@web.de> wrote:
>
> Hello folks,
>
> I use here a german keyboard with a german dvorak layout. My problem is
> that I want to map the motion keys "hjkl". On a german keyboard these 4
> keys looks like this: "hdrn". I've used nnoremap and noremap for mapping
> these keys. But when I map them like this I don't have the keys for
> other things. For example I can't use "dd" for deleting a line. This is
> not a big problem, because I mapped this to ",,". But all keystrokes
> with CTRL and this 4 keys don't work anymore with my solution. Any hints
> for this, because I like these motion keys more than the arrow keys.
>
> TIA Michael
>
>

In case you're still paying attention, I completely forgot about this
tip that maps the keyboard to Dvorak but only when in insert mode:

http://vim.wikia.com/wiki/Using_Vim_with_the_Dvorak_keyboard_layout

I believe (from reading :help 'langmap') that you could do the reverse
and map the keyboard to qwerty only in normal mode using a similar
technique, and the 'keymap' option.

Tony Mechelynck

unread,
May 27, 2008, 12:09:04 PM5/27/08
to vim...@googlegroups.com

I just had a look at that tip.

If you have a Dvorak layout but want to use QWERTY or AZERTY when in
Normal mode, use the tip as-is (with 'langmap'). I suppose a trivial
modification would allow you to use German-Dvorak in Insert mode and
QWERTZ in Normal mode.

If you have a QWERTY/AZERTY/QWERTZ layout but want to use Dvorak layout
in Insert mode, then you would need to write a 'keymap', see also
http://vim.wikia.com/wiki/How_to_make_a_keymap

Best regards,
Tony.
--
Jone's Motto:
Friends come and go, but enemies accumulate.

Efraim Yawitz

unread,
May 28, 2008, 3:38:53 AM5/28/08
to vim...@googlegroups.com
Hasn't anyone left-handed ever wanted to use the left "home keys" for
movement? Whatever they did should work here as well, no?

Michael Wagner

unread,
May 28, 2008, 10:20:55 AM5/28/08
to vim...@googlegroups.com
* Benjamin Fritz <fritzo...@gmail.com> 27.05.2008

> On 5/22/08, Michael Wagner <michae...@web.de> wrote:
> >
> > I use here a german keyboard with a german dvorak layout. My problem is
> > that I want to map the motion keys "hjkl". On a german keyboard these 4
> > keys looks like this: "hdrn". I've used nnoremap and noremap for mapping
> > these keys. But when I map them like this I don't have the keys for
> > other things. For example I can't use "dd" for deleting a line. This is
> > not a big problem, because I mapped this to ",,". But all keystrokes
> > with CTRL and this 4 keys don't work anymore with my solution. Any hints
> > for this, because I like these motion keys more than the arrow keys.
> >
> > TIA Michael
> >
> >
>
> In case you're still paying attention, I completely forgot about this
> tip that maps the keyboard to Dvorak but only when in insert mode:
>
> http://vim.wikia.com/wiki/Using_Vim_with_the_Dvorak_keyboard_layout

Hello Benjamin,

thank you for this tip, but 2 weeks later I'm more familiar this the
keys on my german dvorak layout. The keys for moving right and left are
righthanded and up and down is lefthanded. Now I think it's better that
I have learned the new keys rather than mapping those keys.

Thx Michael

--
"Success without honor is an unseasoned dish; it
will satisfy your hunger, but it won't taste good."
--Joe Paterno

Benjamin Fritz

unread,
May 28, 2008, 10:27:35 AM5/28/08
to vim...@googlegroups.com

I had the same experience...I'm glad it worked out for you as well.

I had the unfortunate experience of someone telling me that:

1) I should use Vim

but

2) Vim was designed for QWERTY, so I'd probably need to give up Dvorak
or make a bunch of mappings

Because of this, I put off trying Vim for years. When I finally tried
it, I think it was actually easier for me to learn Vim with the
alternate layout.

Mikael Jansson

unread,
May 29, 2008, 7:52:59 AM5/29/08
to vim_use
On May 28, 4:27 pm, "Benjamin Fritz" <fritzophre...@gmail.com> wrote:
>
> 1) I should use Vim
>
> but
>
> 2) Vim was designed for QWERTY, so I'd probably need to give up Dvorak
> or make a bunch of mappings
>
> Because of this, I put off trying Vim for years. When I finally tried
> it, I think it was actually easier for me to learn Vim with the
> alternate layout.

The only problem is that one can't use Vim on a QWERTY keyboard
anymore... :-)

--
Mikael Jansson
http://mikael.jansson.be

Benjamin Fritz

unread,
May 29, 2008, 9:10:37 AM5/29/08
to vim...@googlegroups.com

Which is okay with me, because I can't do much of anything on a QWERTY
keyboard anymore. Vim is the least of my worries.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages