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

Re: transliterating on the fly

Expand Messages
  • Yakov Lerner
    ... You can use imap in large doses. Just remap every individual letter, or letter combinations. Althoug there is no autoevent that would be triggered by
    Message 1 of 4 , Aug 3, 2004
    • 0 Attachment
      Denis Perelyubskiy wrote:

      >I would like to implement a script, which would
      >work much like transliterator at translit.ru
      >Namely, when active, the script would process
      >every typed character, and act on it. Based
      >on the current character and previous characters,
      >it would then output russian cyrillic characters.
      >
      >I was wondering if someone can point me in the right
      >place: perhaps an example script that does something
      >similar (processing individual keypresses), or portions
      >of :help
      >
      >
      You can use 'imap' in large doses. Just remap every individual letter,
      or letter combinations.
      Althoug there is no autoevent that would be triggered by buffer contents
      change,
      you can remap(imap) every individual letters either function calls, or
      plainly to something else.

      Here is a small working example of how to include function call in the
      remapping:

      http://www.vim.org/tips/tip.php?tip_id=650
      (Tip #650: abbreviation that prompts whether to expand it or not)

      :help imap , :help map.txt

      Yakov
    • Alejandro Lopez-Valencia
      ... I ve abused it in interesting ways, namely a keyboard map that expands cp1252 or UTF-8 characters into groff character codes while typing. Would that be
      Message 2 of 4 , Aug 3, 2004
      • 0 Attachment
        At 12:58 p.m. 02/08/2004, Denis Perelyubskiy wrote:
        >Hello,
        >
        >I would like to implement a script, which would
        >work much like transliterator at translit.ru
        >Namely, when active, the script would process
        >every typed character, and act on it. Based
        >on the current character and previous characters,
        >it would then output russian cyrillic characters.
        >
        >I was wondering if someone can point me in the right
        >place: perhaps an example script that does something
        >similar (processing individual keypresses), or portions
        >of :help
        >
        >I can't seem to find an event in help that would
        >correspond to a keypress.

        :h 'mbyte-keymap'

        I've abused it in interesting ways, namely a keyboard map that expands
        cp1252 or UTF-8 characters into groff character codes while typing. Would
        that be similar to what you want? See
        http://vim.sourceforge.net/scripts/script.php?script_id=1051 for a copy
        (took me almost two yearsd to decide uploading it ;-).
      Your message has been successfully submitted and would be delivered to recipients shortly.