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

transliterating on the fly

Expand Messages
  • Denis Perelyubskiy
    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
    Message 1 of 4 , Aug 2, 2004
    • 0 Attachment
      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.

      Thanks!

      denis
      --
      // mailto: Denis Perelyubskiy <lists at overwhelmTAKECAPITALSOUT dot net>
      // icq : 12359698
    • Benji Fisher
      ... I think the simplest thing you can do (and it is not very simple) is to :imap every alphabetic character. For an example, see word_complete.vim at
      Message 2 of 4 , Aug 2, 2004
      • 0 Attachment
        On Mon, Aug 02, 2004 at 10:58:15AM -0700, 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.

        I think the simplest thing you can do (and it is not very simple)
        is to :imap every alphabetic character. For an example, see
        word_complete.vim at
        http://vim.sourceforge.net/scripts/script.php?script_id=73

        HTH --Benji Fisher
      • 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 3 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 4 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.