2

Vim is optimized for the standard US keyboard:

enter image description here

If we want to use it with the following QWERTZ keyboard (common in Austria and Germany):

enter image description here

What should we do? (aside from using the US keyboard map, of course)

Especially problematic are the :, ;, /, ? keys and the backtick, which are used very often and on the QWERTZ keyboard above difficult to reach and pretty counter-intuitive. For example, after pressing f,xsearching for the next 'x' with ; involves pressing the shift key.

Maybe the following modifications in ~/.vimrc are a good idea?

nnoremap ü  ` 
nnoremap ä  / 
nnoremap Ä  ?  
nnoremap ö  ; 
nnoremap Ö  :
nnoremap :  <Nop>

(and the same lines with vnoremap instead of nnoremap)

Of course, one also has to disable deadkeys (e.g. so we can use ctrl+^ for switching buffers). Exchanging caps-lock with escape is also helpful. So we insert this in the file /usr/share/X11/xkb/symbols/de:

partial alphanumeric_keys
xkb_symbols "switch_esc_caps" {
    include "de(nodeadkeys)"
    name[Group1] = "Germany B";
    key <CAPS> { [ Escape ] } ;
};

And put in the directory ~/.Xsession.d the script:

#!/bin/bash

setxkbmap -layout de -variant switch_esc_caps

Everything ok that way? At least it seems to work... is there a cleaner approach?

Now there are still problems:

  1. The backtick is also a mark for the last position, is there a way to redefine this? So that ü becomes the mark for the last position and we get back to the last position by pressing ü,ü?

  2. Though pressing ä opens the search, in substitution commands we still have to use the /.

    Maybe this is not a good idea, but in sed one can choose a different delimiter than /, like:

    'abc' | sed -e 's-abc-def-g'

    Is something similar possible in vim?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.