Vim Mapping Umlaute: Tips & Fixes

  • Thread starter Thread starter DrDu
  • Start date Start date
  • Tags Tags
    Mapping
Click For Summary

Discussion Overview

The discussion revolves around mapping umlauts in Vim while editing German LaTeX files using a US keyboard. Participants explore the challenges of timing for key sequences and potential solutions, including adjusting timeout settings and keyboard layouts.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant notes the difficulty of typing umlauts quickly enough in Vim due to cursor movement issues and inquires about adjusting the timing.
  • Another participant suggests checking the 'timeoutlen' setting in Vim, which defaults to 1 second, and recommends adjusting it for better usability.
  • A suggestion is made to consider switching to a German keyboard layout to facilitate easier typing of special characters, although one participant expresses concern about the practicality of typing LaTeX commands on such a layout.
  • One participant shares their experience testing different 'timeoutlen' values and encourages finding a personal sweet spot for timing.
  • Another participant mentions the option of using abbreviations for characters, which may require additional keystrokes but could be beneficial in some cases.
  • A participant discusses preferences for setting 'notimeout' and 'ttimeout' to manage key mappings without interrupting typing flow.
  • There is a viewpoint that shorter timeouts may be preferable to avoid unnecessary interruptions when typing certain characters.

Areas of Agreement / Disagreement

Participants express varying opinions on the best approach to managing key mappings and timing in Vim. While some agree on the utility of adjusting 'timeoutlen', others have differing preferences regarding the use of keyboard layouts and timeout settings. The discussion remains unresolved with multiple competing views.

Contextual Notes

Participants mention specific challenges related to typing LaTeX commands and the implications of different keyboard layouts, but do not resolve the effectiveness of each proposed solution.

DrDu
Science Advisor
Messages
6,423
Reaction score
1,004
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?
 
Physics news on Phys.org
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.)
 
oli4 said:
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.)

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'.
 
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...
 
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.
 
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 :)
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
5K
  • Sticky
  • · Replies 0 ·
Replies
0
Views
5K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 43 ·
2
Replies
43
Views
10K
  • · Replies 21 ·
Replies
21
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 4 ·
Replies
4
Views
10K