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.
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
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.
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.
> > :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!
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.
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.
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
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.
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.