Loading ...
Sorry, an error occurred while loading the content.

20657Re: decapitlising on the fly

Expand Messages
  • Sven Brüggemann
    Sep 3, 2001
      > I know I am not the only one with the problem of typing THis instead of
      > This (usually at the start of a sentence).

      > Some time ago I asked on this list whether there is a way to
      > dynamically correct this error (without having to explicitly define an
      > abbreviation for each possible instance which is ridiculous).

      > in ms word over the last few days and they correct this error on the
      > fly once you have completed the offending word.

      > Anything they can do we can do better? Or can we?

      That is certainly possible. AFAIK there is no event FinishedWord in VIM, but for normal text (you wouldn't want to use this auto correction when coding, do you?) an imap for <space> should to the job.

      I never really used marks so I struggle with the cursor positioning - I use a German keyboard layout where backticks are dead keys so I don't know whether I did something wrong or my keyboard fooled me. Certainly Benji can help here.

      I mapped <space> to a substitute command that replaces two uppercase characters at the beginning of a word by an uppercase and a lowercase character:

      imap <space> <esc>{mark cursor position here}:. s/\<\(\u\)\(\u\)\(\w*\)/\1\l\2\e\3/eg{return to cursor position here}

      Since it works on the whole line, it is a little bit more annoying than MS Word (regarding this special feature) but let's see how Benji and the others can improve this.

      Kind regards

    • Show all 6 messages in this topic