Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Vim mapping umlaute

  1. Feb 14, 2013 #1

    DrDu

    User Avatar
    Science Advisor

    When I am editing German Latex files in vim using a us keyboard, I would like to map "a to a-umlaut etc. I added corresponding imap commands in my vimrc and they work in principle.
    However I have to type "a" after """ at a certain speed, if not, the cursor jumps from before """ to after it and won't map the sequence any more. Is that standard and can that time be set?
     
  2. jcsd
  3. Feb 14, 2013 #2
    Hi DrDu
    Yes, there is, it's timeoutlen
    by default I think it is set to 1s, (1000ms) so it should be enough, but just verify that you don't have something abnormaly low by typing :set timeoutlen and then set it it whatever suits you better in your vimrc.
    However, I think it would be best if you added a german or some other european keyboard layout and learn to type the right key, because it would work anywhere out of vim and would give you access to all the other letters without having to map them all :) (and their upper case versions etc.)
     
  4. Feb 14, 2013 #3

    DrDu

    User Avatar
    Science Advisor

    Thank you very much oli, I will play around with timeoutlen.
    I know how to type both on an English and on a German keyboard. The point is that it is very nasty to type latex commands on a German keyboard as \[]{}, which are most frequent in latex, all require multiple keys.
    After all, one of the advantages of latex is that you are programming text and don't need for that task more than the ASCII characters. However, I am playing around with the spell checker, which runs into problems with words like 'Aufr"aumen'.
     
  5. Feb 14, 2013 #4
    Ahh yes, of course, you did say it was Latex but I didn't think about how it would make things that much more cumbersome.
    timeoutlen is the way to go, I tested it right now with 1000 and 3000 and you will certainly find the sweet spot for you :)
    If not, you could also try an abbreviation, that means you would have to add a space (and hit backspace) every-time, but maybe it can suits you better, I use abbreviations in emacs for some of those letters (greek mostly but some other 'mathematical formula' related symbols) and it works well enough

    Cheers...
     
  6. Feb 14, 2013 #5

    DrDu

    User Avatar
    Science Advisor

    Ok, I read the help on timeout:
    If you don't like timeout for mappings like me, it is advisable to "set notimeout" and "set ttimeout". Then a timeout is still applied with key codes.
     
  7. Feb 14, 2013 #6
    It has to be a matter of taste, I would tend to set that timeout as as short as possible, because otherwise, if you want to just type " you have to interrupt the sequence with two cancelling keystrokes.
    But there are certainly cases where it is a winning strategy
    for instance, if you have this habit of, when you do want to write " you are aware you will close them, so you hit ""← and therefore there is no cost :)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Vim mapping umlaute
  1. MATLAB Logistic Map (Replies: 0)

Loading...