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

Chinese input with vim: please help

Expand Messages
  • Neil Zanella
    Hello, I thought I had posted this before but either got no replies or the message did not get through so I guess I ll post again... ... I would like to use
    Message 1 of 3 , Jan 30, 2004
    • 0 Attachment
      Hello,

      I thought I had posted this before but either got no replies or the
      message did not get through so I guess I'll post again...

      -----------------------------------------------------------------------

      I would like to use vim to insert Chinese characters. I would prefer to
      use pinyin to input the characters if possible.

      I am running Fedora Core 1 Linux <http://fedora.redhat.com/download/>
      which comes with vim 6.2 <http://www.vim.org/>. On this system vim was
      precompiled with options "+multi_byte +iconv +xim" among others as can be
      seen by issuing the command: vim --version|grep "xim\|multi_byte\|iconv".
      Hence I should be able to read and compose Chinese characters with vim.

      The system has two Chinese XIM (X Input Method) servers installed. These
      are xcin 2.5.3.pre3 <http://xcin.linux.org.tw/> and miniChinput 0.0.3 as
      found at <http://minichinput.sourceforge.net/>. On the system the xcin
      server is called xcin but the miniChinput server is called chinput.
      However, the chinput executable from the miniChinput package is apparently
      just a stripped down version of the real Chinput server which can be found
      at <http://www.opencjk.org/~yumj/project-chinput-e.html>. The Chinput
      package is not distributed with Fedora Core 1 and neither is Fxitx
      <http://www.fcitx.org/cgi-bin/wiki/moin.cgi/English> which is yet another
      XIM server for Linux. There are probably even more than the four chinese
      input servers I just described out there but the one I mentioned seem to
      be the most popular.

      Apparently with emacs it is possible to input chinese characters without
      even needing to start an X Input Method server at all, but I have not
      tried this, plus I am not familiar with emacs, and would like to be
      able to use vim to input Chinese characters instead.

      When I log into Fedora Core 1 I have the following settings:

      LANG: en_US.UTF-8
      XMODIFIERS: @im=none
      LC_MESSAGES:
      LC_CTYPE:
      LC_ALL:

      and no XIM server running at all (as shown in the XMODIFIER environment
      variable I suppose or alternatively seen by issuing the ps -aux command).

      However, the GDM login screen has a language option that allows you to
      choose one of the following among others prior to logging in provided you
      set up these languages when Fedora Linux was installed:

      Chinese (simplified), in which case I get the following settings:

      LANG: zh_CN.UTF-8
      XMODIFIERS: @im=Chinput
      LC_MESSAGES:
      LC_CTYPE:
      LC_ALL:


      or Chinese (traditional), in which case I get these settings:

      LANG: zh_TW.UTF-8
      XMODIFIERS: @im=xcin
      LC_MESSAGES:
      LC_CTYPE:
      LC_ALL:

      where zh stands for Zhong1wen2 (Chinese) with variants CN (China) and TW
      (Taiwan).

      -----------------------------------------------------------------------------

      So, basically, my questions are, how does vim go about supporting Chinese
      input? Does it rely on an XIM server or can it do without just like emacs?
      What are the advantages or disadvantages of relying on an XIM server?
      Which XIM servers does vim support? How do I go about using one of the XIM
      input servers (preferably miniChinput) with vim? How can I input Hanyu
      Pinyin and have the Mandarin sounds translated to pictograms and displayed
      by vim on the terminal window?

      I can see that there is a file called
      /usr/share/vim/vim62/keymap/pinyin.vim
      installed on my system but I am not
      quite sure how to use it.

      Sorry for asking all these questions,
      I am somewhat new to all these programs.

      Thanks!

      Neil
    • Benji Fisher
      ... I have not experience with this myself, but have you read ... yet? There is a pointer there to the appropriate section of the users manual. For an
      Message 2 of 3 , Jan 30, 2004
      • 0 Attachment
        On Fri, Jan 30, 2004 at 10:50:23PM -0330, Neil Zanella wrote:
        >
        > Hello,
        >
        > I thought I had posted this before but either got no replies or the
        > message did not get through so I guess I'll post again...
        >
        > -----------------------------------------------------------------------
        >
        > I would like to use vim to insert Chinese characters. I would prefer to
        > use pinyin to input the characters if possible.

        I have not experience with this myself, but have you read

        :help mbyte.txt

        yet? There is a pointer there to the appropriate section of the users'
        manual. For an explanation of what keymap/pinyin.vim is good for, see
        especially

        :help mbyte-keymap

        HTH --Benji Fisher
      • Sam Hsu
        Hi Neil, I think I can share with you about using chinese input under Linux in vim6.2 . I use fcitx, which is one of the xim server you ve found. Since I m not
        Message 3 of 3 , Feb 1, 2004
        • 0 Attachment
          Hi Neil,

          I think I can share with you about using chinese input under Linux in
          vim6.2 .

          I use fcitx, which is one of the xim server you've found. Since I'm
          not root, I will source one file, which contains such settings:

          setenv LANG zh_CN
          setenv LANGUAGE zh_CN.GB2312:zh_CN:zh
          setenv ENC gb
          setenv XIM fcitx
          setenv XIM_PROGRAM fcitx
          setenv XMODIFIERS "@im=fcitx"

          before running fcitx as xim server.

          Then start *Gvim* 6.2, <Ctrl-Space> will trigger the chinese input, it
          supports WuBi,Pinyin, <Ctrl-Shift> to shift the method.

          But if you want to input chinese in terminal vim, I prefer Cxterm.


          HTH.

          Neil Zanella wrote:
          > Hello,
          >
          > I thought I had posted this before but either got no replies or the
          > message did not get through so I guess I'll post again...
          >
          > -----------------------------------------------------------------------
          >
          > I would like to use vim to insert Chinese characters. I would prefer to
          > use pinyin to input the characters if possible.
          >
          > Fxitx
          > <http://www.fcitx.org/cgi-bin/wiki/moin.cgi/English> which is yet another
          > XIM server for Linux. There are probably even more than the four chinese
          > input servers I just described out there but the one I mentioned seem to
          > be the most popular.
          >
          >
          > Chinese (simplified), in which case I get the following settings:
          >
          > LANG: zh_CN.UTF-8
          > XMODIFIERS: @im=Chinput
          > LC_MESSAGES:
          > LC_CTYPE:
          > LC_ALL:
          >
          >
          > or Chinese (traditional), in which case I get these settings:
          >
          > LANG: zh_TW.UTF-8
          > XMODIFIERS: @im=xcin
          > LC_MESSAGES:
          > LC_CTYPE:
          > LC_ALL:
          >
          > where zh stands for Zhong1wen2 (Chinese) with variants CN (China) and TW
          > (Taiwan).
          >
          > -----------------------------------------------------------------------------
          >
          > So, basically, my questions are, how does vim go about supporting Chinese
          > input? Does it rely on an XIM server or can it do without just like emacs?
          > What are the advantages or disadvantages of relying on an XIM server?
          > Which XIM servers does vim support? How do I go about using one of the XIM
          > input servers (preferably miniChinput) with vim? How can I input Hanyu
          > Pinyin and have the Mandarin sounds translated to pictograms and displayed
          > by vim on the terminal window?
          >
          --
          Yours
          Sam
          MTB Group Synopsys Inc.
          Office Tel:(+86)-21-32204540 x 70319
          15F, Zhaofeng Plaza, 1027 Changning Road,
          200051 Shanghai, China
        Your message has been successfully submitted and would be delivered to recipients shortly.