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

Re: unicode for Georgian

Expand Messages
  • Kenneth Reid Beesley
    ... zkutch, RE: gvim, Unicode, Georgian mxedruli Here s how I have implemented Georgian mxedruli in gvim. Corrections and suggestions would be welcome. For
    Message 1 of 8 , Jan 9, 2012
    View Source
    • 0 Attachment
      > To input Georgian characters, you can:
      > - use a keymap (and create your own if there is no satisfactory one), see
      > :help 'keymap'
      > :help keymap-file-format


      zkutch,

      RE: gvim, Unicode, Georgian mxedruli

      Here's how I have implemented Georgian mxedruli in gvim. Corrections and suggestions
      would be welcome.

      For displaying Georgian mxedruli, the DejaVu Sans Mono font has the glyphs (and is a good
      general Unicode mono font, suitable for gvim). You will have to install this font (or a similar
      Unicode mono font) on Windows wherever you install fonts so that they are visible to gvim.

      Keymap

      I assume here that you want to use a keymap, which allows you to type Roman letters,
      and simple sequences (bigraphs, trigraphs, etc.) of Roman letters on your keyboard. These
      are intercepted by the keymap and turned into mxedruli characters before being entered
      into the buffer. You type an unambiguous Roman _transliteration_ of mxedruli, so the keymap
      (below) is titled mxedruli-translit_utf-8.vim. This mxedruli-translit_utf-8.vim file should be
      installed in your ~/.vim/keymap/ directory (or the equivalent for Windows).

      Key points:
      1. You have to tell gvim to use DejaVu Sans Mono (or another Unicode-encoded
      mono font that contains the mxedruli glyphs).
      2. You want gvim to store/encode text internally in utf-8 (a default encoding of Unicode)
      3. You want gvim to save buffers to file in utf-8 and read files in utf-8
      4. You want easy ways to activate and de-activate the mxedruli keymap when you type
      You do this via commands in your .gvimrc file.


      I'm not a Windows user, but something close to the following should work for you.

      In your .gvimrc file, add the lines:

      if has ("multi_byte") " i.e. compiled for multi_byte, needed for Unicode
      if &encoding !~? '^u' " if encoding does not start u or U
      if &termencoding=='' " don't clobber keyboard locale
      let &termencoding=&encoding
      endif
      set encoding=utf-8 " how vim should represent text internally
      endif
      " fileencodings, tried in order when opening an existing file
      set fileencodings=ucs-bom,utf-8,iso-8859-1
      setglobal bomb
      " fileencoding is the encoding vim will use to write files
      setglobal fileencoding=utf-8
      else
      echomsg 'Warning: Multibyte support not compiled in.'
      endif

      set anti guifont="DejaVu Sans Mono:h14

      " input sequences to activate the mxedruli keymap
      nmap ,m :setlocal keymap=mxedruli-translit_utf-8<Enter>
      imap ,m <Esc>:setlocal keymap=mxedruli-translit_utf-8<Enter>a

      " toggle keymaps (to previous and back) N.B. <C-^> works only in Insert mode
      " and in command-line mode
      nmap ,. i<C-^><Esc>
      imap ,. <C-^>
      cmap ,. <C-^>

      " return to the neutral keymap
      nmap ,, :setlocal keymap="neutral"<Enter>
      imap ,, <Esc>:setlocal keymap="neutral"<Enter>a

      " end of additions to .gvimrc

      Put the mxedruli-translit_utf-8.vim file (below) in your ~/.vim/keymap/ directory
      (or equivalent for Windows).

      " mxedruli-translit_utf-8.vim
      "
      " Maintainer: Kenneth R. Beesley krbeesley ATT gmail DOTT com
      " Created: 2008-09-21
      " Last Changed: 2012-01-09

      " vim keymap (input method) for entering Georgian mxedruli

      " Installation: place this file in ~/.vim/keymap/

      " Selection inside gvim
      " :setlocal keymap=mxedruli-translit_utf-8
      "
      " or, in your .gvimrc file, include the commands
      " nmap ,m :setlocal keymap=mxedruli-translit_utf-8<Enter>
      " imap ,m <Esc>:setlocal keymap=mxedruli-translit_utf-8<Enter>a
      "
      " nmap ,. i<C-^><Esc>
      " imap ,. <C-^>
      " cmap ,. <C-^>

      " nmap ,, :setlocal keymap="neutral"<Enter>
      " imap ,, <Esc>:setlocal keymap="neutral"<Enter>a
      "
      " so that you can activate the mxedruli input method by typing ,m
      " toggle back and forth by typing ,.
      " and return to the "neutral" keymap by typing ,,

      " **************************************************************

      " this short name is for display in the status line
      let b:keymap_name="mxedruli-translit"

      " change the lCursor color (the color when this keymap is active)
      highlight lCursor guifg=NONE guibg=Cyan

      loadkeymap

      a <Char-0x10D0>
      b <Char-0x10D1>
      g <Char-0x10D2>
      d <Char-0x10D3>
      e <Char-0x10D4>
      v <Char-0x10D5>
      z <Char-0x10D6>
      t <Char-0x10D7>
      i <Char-0x10D8>
      k' <Char-0x10D9>
      l <Char-0x10DA>
      m <Char-0x10DB>
      n <Char-0x10DC>
      o <Char-0x10DD>
      p' <Char-0x10DE>
      Z <Char-0x10DF>
      r <Char-0x10E0>
      s <Char-0x10E1>
      t' <Char-0x10E2>
      u <Char-0x10E3>
      p <Char-0x10E4>
      k <Char-0x10E5>
      G <Char-0x10E6>

      q' <Char-0x10E7>
      q <Char-0x10E7> " no q vs. q' distinction

      S <Char-0x10E8>
      tS <Char-0x10E9>
      ts <Char-0x10EA>
      dz <Char-0x10EB>
      ts' <Char-0x10EC>
      tS' <Char-0x10ED>

      x <Char-0x10EE>
      X <Char-0x10EE> " x and X the same

      dZ <Char-0x10EF>
      h <Char-0x10F0>

      " literalize with preceding backslash
      " (seldom needed)

      \p <Char-0x10E4>
      \t <Char-0x10D7>
      \k <Char-0x10E5>
      \d <Char-0x10D3>
      \s <Char-0x10E1>
      \S <Char-0x10E8>
      \z <Char-0x10D6>
      \Z <Char-0x10DF>
      \' '


      " literalize the backslash itself
      \\ \

      " end of mxedruli-translit_utf-8.vim

      With this setup, when you launch gvim, you just need to type

      ,m

      i.e. a comma followed immediately by an m, to activate the
      mxedruli keymap. While this mode is active, you just type
      a, e, i, o and u to enter the obvious vowels, and (as far as
      possible) you type the obvious Roman equivalents for the
      consonants. Ejectives are entered with a roman consonant
      followed by a single quote: e.g. p', t', k'. See the keymap
      above for other mapping details.

      See
      http://en.wikipedia.org/wiki/Georgian_alphabet
      for the Unicode code point values.

      You can of course modify the keymap to your taste by changing
      the input sequences on the left side, as long as each input sequence is unique.

      To toggle between the mxedruli keymap and the previous
      keymap, just type ,. (i.e. comma followed immediately by
      a period).

      To return to the default/normal keymap, just type
      ,,
      i.e. two commas together.


      Good luck,

      Ken

      On 7Jan2012, at 00:42, Tony Mechelynck wrote:

      > On 04/01/12 23:01, Zura Kutchava wrote:
      >> To:
      >>
      >>
      >>
      >> Dear friends
      >>
      >> finding and trying everything that supports unicode in gvim in windows xp or 2003. No fonts, no digraphs, no countless encodings help to display
      >> unicode symbols from 10d0 to 10f0 (georgian)
      >>
      >> may be somebody have any idea?
      >>
      >> i little programming in c/c++ so if it will be good i can try to help
      >>
      >> thanks beforehand
      >>
      >> zkutch
      >>
      >
      > About fonts in gvim, see
      > http://vim.wikia.com/Setting_the_font_in_the_GUI
      > On Windows, the command
      > :set gfn=*
      > allows you to choose a font by a menu. It's been too long since I've left Windows to remember, but maybe the display on the bottom of that dialog is actually an input area, where you can paste any text (e.g. Georgian text) from the clipboard and see how it would be displayed in that font.
      >
      > About using Unicode in Vim (in General), see
      > http://vim.wikia.com/Working_with_Unicode
      >
      > To input Georgian characters, you can:
      > - use a keymap (and create your own if there is no satisfactory one), see
      > :help 'keymap'
      > :help keymap-file-format
      >
      > - use digraphs (and create your own if there are no satisfactory ones)
      > see
      > :help :digraph
      >
      > - and if nothing else avails, you can always use the method described under
      > :help i_CTRL-V_digit
      >
      >
      > Best regards,
      > Tony.
      > --
      > ARTHUR: Right! Knights! Forward!
      > ARTHUR leads a charge toward the castle. Various shots of them battling on,
      > despite being hit by a variety of farm animals.
      > "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
      >
      > --
      > You received this message from the "vim_multibyte" maillist.
      > For more information, visit http://www.vim.org/maillist.php


      ******************************
      Kenneth R. Beesley, D.Phil.
      P.O. Box 540475
      North Salt Lake, UT
      84054 USA





      --
      You received this message from the "vim_multibyte" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Zura Kutchava
      Thanks a lot i check your keymap and setting and, of course, it works for gvim73-46 i also changed keymap (put in attachment) to coincide it with windows
      Message 2 of 8 , Jan 10, 2012
      View Source
      • 0 Attachment
        Thanks a lot

        i check your keymap and setting and, of course, it works for gvim73-46

        i also changed keymap (put in attachment) to coincide it with windows georgian keyboard, for that people who use georgian keyboard in windows. It came from old (befor computers) georgian printing press keyboard. So for 73-46 users everything is ready.

        the good side of this keyboard is that it's possible to type one key for one georgian letter. Hope it will be usefull for georgian keyboard users.

        let me repeat that most easy is install gvim-7-3-386 and in it directly switch keyboard layots

        zkutch





        --- On Mon, 1/9/12, Kenneth Reid Beesley <krbeesley@...> wrote:

        > From: Kenneth Reid Beesley <krbeesley@...>
        > Subject: Re: unicode for Georgian
        > To: vim_multibyte@...
        > Date: Monday, January 9, 2012, 10:57 PM
        > > To input Georgian characters,
        > you can:
        > > - use a keymap (and create your own if there is no
        > satisfactory one), see
        > >     :help 'keymap'
        > >     :help keymap-file-format
        >
        >
        > zkutch,
        >
        > RE:  gvim, Unicode, Georgian mxedruli
        >
        > Here's how I have implemented Georgian mxedruli in
        > gvim.  Corrections and suggestions
        > would be welcome.
        >
        > For displaying Georgian mxedruli, the DejaVu Sans Mono font
        > has the glyphs (and is a good
        > general Unicode mono font, suitable for gvim).   
        > You will have to install this font (or a similar
        > Unicode mono font) on Windows wherever you install fonts so
        > that they are visible to gvim.
        >
        >         Keymap
        >
        > I assume here that you want to use a keymap, which allows
        > you to type Roman letters,
        > and simple sequences (bigraphs, trigraphs, etc.) of Roman
        > letters on your keyboard.  These
        > are intercepted by the keymap and turned into mxedruli
        > characters before being entered
        > into the buffer.  You type an unambiguous Roman
        > _transliteration_ of mxedruli, so the keymap
        > (below) is titled mxedruli-translit_utf-8.vim.  This
        > mxedruli-translit_utf-8.vim file should be
        > installed in your ~/.vim/keymap/ directory (or the
        > equivalent for Windows).
        >
        > Key points:
        >     1.  You have to tell gvim to use
        > DejaVu Sans Mono (or another Unicode-encoded
        >         mono font that
        > contains the mxedruli glyphs).
        >     2.  You want gvim to store/encode
        > text internally in utf-8 (a default encoding of Unicode)
        >     3.  You want gvim to save buffers
        > to file in utf-8 and read files in utf-8
        >     4.  You want easy ways to activate
        > and de-activate the mxedruli keymap when you type
        > You do this via commands in your .gvimrc file.
        >
        >
        > I'm not a Windows user, but something close to the
        > following should work for you.
        >
        > In your .gvimrc file, add the lines:
        >
        > if has ("multi_byte")      " i.e. compiled
        > for multi_byte, needed for Unicode
        >   if &encoding !~? '^u'    " if encoding
        > does not start u or U
        >     if &termencoding==''    "
        > don't clobber keyboard locale
        >       let &termencoding=&encoding
        >     endif
        >     set encoding=utf-8  " how vim should
        > represent text internally
        >   endif
        >   " fileencodings, tried in order when opening an
        > existing file
        >   set fileencodings=ucs-bom,utf-8,iso-8859-1
        >   setglobal bomb
        >   " fileencoding is the encoding vim will use to write
        > files
        >   setglobal fileencoding=utf-8
        > else
        >   echomsg 'Warning: Multibyte support not compiled
        > in.'
        > endif
        >
        > set anti guifont="DejaVu Sans Mono:h14
        >
        > " input sequences to activate the mxedruli keymap
        > nmap ,m       :setlocal
        > keymap=mxedruli-translit_utf-8<Enter>
        > imap ,m  <Esc>:setlocal
        > keymap=mxedruli-translit_utf-8<Enter>a
        >
        > " toggle keymaps (to previous and back) N.B. <C-^>
        > works only in Insert mode
        > "   and in command-line mode
        > nmap ,.  i<C-^><Esc>
        > imap ,.   <C-^>
        > cmap ,.   <C-^>
        >
        > " return to the neutral keymap
        > nmap ,,   
        >      :setlocal
        > keymap="neutral"<Enter>
        > imap ,, <Esc>:setlocal
        > keymap="neutral"<Enter>a
        >
        > " end of additions to .gvimrc
        >
        > Put the mxedruli-translit_utf-8.vim file (below) in your
        > ~/.vim/keymap/  directory
        > (or equivalent for Windows).
        >
        > " mxedruli-translit_utf-8.vim
        > "
        > " Maintainer:  Kenneth R. Beesley  krbeesley ATT
        > gmail DOTT com
        > " Created: 2008-09-21
        > " Last Changed: 2012-01-09
        >
        > " vim keymap (input method) for entering Georgian mxedruli
        >
        > " Installation:  place this file in ~/.vim/keymap/
        >
        > " Selection inside gvim
        > " :setlocal keymap=mxedruli-translit_utf-8
        > "
        > " or, in your .gvimrc file, include the commands
        > " nmap ,m       :setlocal
        > keymap=mxedruli-translit_utf-8<Enter>
        > " imap ,m  <Esc>:setlocal
        > keymap=mxedruli-translit_utf-8<Enter>a
        > "
        > " nmap ,.  i<C-^><Esc>
        > " imap ,.   <C-^>
        > " cmap ,.   <C-^>
        >
        > " nmap ,,   
        >      :setlocal
        > keymap="neutral"<Enter>
        > " imap ,, <Esc>:setlocal
        > keymap="neutral"<Enter>a
        > "
        > " so that you can activate the mxedruli input method by
        > typing  ,m
        > " toggle back and forth by typing  ,.
        > " and return to the "neutral" keymap by typing ,,
        >
        > "
        > **************************************************************
        >
        > " this short name is for display in the status line
        > let b:keymap_name="mxedruli-translit"
        >
        > " change the lCursor color (the color when this keymap is
        > active)
        > highlight lCursor guifg=NONE guibg=Cyan
        >
        > loadkeymap
        >
        > a    <Char-0x10D0>
        > b    <Char-0x10D1>
        > g    <Char-0x10D2>
        > d    <Char-0x10D3>
        > e    <Char-0x10D4>
        > v    <Char-0x10D5>
        > z    <Char-0x10D6>
        > t    <Char-0x10D7>
        > i    <Char-0x10D8>
        > k'    <Char-0x10D9>
        > l    <Char-0x10DA>
        > m    <Char-0x10DB>
        > n    <Char-0x10DC>
        > o    <Char-0x10DD>
        > p'    <Char-0x10DE>
        > Z    <Char-0x10DF>
        > r    <Char-0x10E0>
        > s    <Char-0x10E1>
        > t'    <Char-0x10E2>
        > u    <Char-0x10E3>
        > p    <Char-0x10E4>
        > k    <Char-0x10E5>
        > G    <Char-0x10E6>
        >
        > q'    <Char-0x10E7>
        > q    <Char-0x10E7>   "
        > no q vs. q' distinction
        >
        > S    <Char-0x10E8>
        > tS    <Char-0x10E9>
        > ts    <Char-0x10EA>
        > dz    <Char-0x10EB>
        > ts'    <Char-0x10EC>
        > tS'    <Char-0x10ED>
        >
        > x    <Char-0x10EE>
        > X    <Char-0x10EE>    "
        > x and X the same
        >
        > dZ    <Char-0x10EF>
        > h    <Char-0x10F0>
        >
        > " literalize with preceding backslash
        > " (seldom needed)
        >
        > \p    <Char-0x10E4>
        > \t    <Char-0x10D7>
        > \k    <Char-0x10E5>
        > \d    <Char-0x10D3>
        > \s    <Char-0x10E1>
        > \S    <Char-0x10E8>
        > \z    <Char-0x10D6>
        > \Z    <Char-0x10DF>
        > \'    '
        >
        >
        > " literalize the backslash itself
        > \\ \
        >
        > " end of mxedruli-translit_utf-8.vim
        >
        > With this setup, when you launch gvim, you just need to
        > type
        >
        > ,m
        >
        > i.e. a comma followed immediately by an m, to activate the
        > mxedruli keymap.  While this mode is active, you just
        > type
        > a, e, i, o and u to enter the obvious vowels, and (as far
        > as
        > possible) you type the obvious Roman equivalents for the
        > consonants.  Ejectives are entered with a roman
        > consonant
        > followed by a single quote: e.g. p', t', k'.  See the
        > keymap
        > above for other mapping details.
        >
        > See
        > http://en.wikipedia.org/wiki/Georgian_alphabet
        > for the Unicode code point values.
        >
        > You can of course modify the keymap to your taste by
        > changing
        > the input sequences on the left side, as long as each input
        > sequence is unique.
        >
        > To toggle between the mxedruli keymap and the previous
        > keymap, just type   ,.    (i.e.
        > comma followed immediately by
        > a period).
        >
        > To return to the default/normal keymap, just type
        > ,,
        > i.e. two commas together.
        >
        >
        > Good luck,
        >
        > Ken
        >
        > On 7Jan2012, at 00:42, Tony Mechelynck wrote:
        >
        > > On 04/01/12 23:01, Zura Kutchava wrote:
        > >> To:
        > >>
        > >>
        > >>
        > >>  Dear friends
        > >>
        > >> finding and trying everything that supports
        > unicode in gvim in windows xp or 2003. No fonts, no
        > digraphs, no countless encodings help to display
        > >> unicode symbols from 10d0 to 10f0 (georgian)
        > >>
        > >> may be somebody have any idea?
        > >>
        > >> i little programming in c/c++ so if it will be
        > good i can try to help
        > >>
        > >> thanks beforehand
        > >>
        > >> zkutch
        > >>
        > >
        > > About fonts in gvim, see
        > >     http://vim.wikia.com/Setting_the_font_in_the_GUI
        > > On Windows, the command
        > >     :set gfn=*
        > > allows you to choose a font by a menu. It's been too
        > long since I've left Windows to remember, but maybe the
        > display on the bottom of that dialog is actually an input
        > area, where you can paste any text (e.g. Georgian text) from
        > the clipboard and see how it would be displayed in that
        > font.
        > >
        > > About using Unicode in Vim (in General), see
        > >     http://vim.wikia.com/Working_with_Unicode
        > >
        > > To input Georgian characters, you can:
        > > - use a keymap (and create your own if there is no
        > satisfactory one), see
        > >     :help 'keymap'
        > >     :help keymap-file-format
        > >
        > > - use digraphs (and create your own if there are no
        > satisfactory ones)
        > > see
        > >     :help :digraph
        > >
        > > - and if nothing else avails, you can always use the
        > method described under
        > >     :help i_CTRL-V_digit
        > >
        > >
        > > Best regards,
        > > Tony.
        > > --
        > > ARTHUR: Right! Knights! Forward!
        > >   ARTHUR leads a charge toward the
        > castle.  Various shots of them battling on,
        > >   despite being hit by a variety of
        > farm animals.
        > >             
        >    "Monty Python and the Holy Grail" PYTHON
        > (MONTY) PICTURES LTD
        > >
        > > --
        > > You received this message from the "vim_multibyte"
        > maillist.
        > > For more information, visit http://www.vim.org/maillist.php
        >
        >
        > ******************************
        > Kenneth R. Beesley, D.Phil.
        > P.O. Box 540475
        > North Salt Lake, UT
        > 84054  USA
        >
        >
        >
        >
        >
        > --
        > You received this message from the "vim_multibyte"
        > maillist.
        > For more information, visit http://www.vim.org/maillist.php
        >

        --
        You received this message from the "vim_multibyte" maillist.
        For more information, visit http://www.vim.org/maillist.php
      Your message has been successfully submitted and would be delivered to recipients shortly.