[luau] Re: CJK Input (Limbo 2 Gone from Mirrors)

Ray Strode halfline at hawaii.rr.com
Wed Aug 21 13:41:01 PDT 2002


> Thanks Ray.  Would you be able to show me how to input and print CJK 
> characters in vim?

I'm sorry, but I don't really know how.   At one point I was playing XIM 
(X Input Method), but
I never really learned exactly how to set everything up.  I'll tell you 
what I do know.

Vim supports XIM, so if you can get CJK character input to work for any 
other XIM application
then the same method should work for Vim.

XIM requires what's called an input server.  Examples of input servers 
are kinput2, xwnmo
(Japanese), and xcin (Simplified and Traditional Chinese).

There are four different methods of input using XIM: on the spot, over 
the spot, off the spot,
and root window. Mozilla has a nice document that says the differences 
between those:
http://www.mozilla.org/projects/intl/input-method-spec.html

Vim only supports over the spot, off the spot, and root window.

When you run your input server, you'll need to be in the correct locale 
and have the correct
fonts installed.  

You can find out what locale's your system supports by typing "locale -a".

For instance, simplified chinese is zh_CN and japanese is ja_JP.  

You have to tell X Windows which input server you are using.  You can do 
by settings
the XMODIFIERS environment variable or by adding a line to your 
~/.Xdefaults file.
eg. type:
export XMODIFIERS=@im=kinput2
or add
*.inputMethod: kinput2
to your ~/.Xdefaults file

Most input servers allow you to activate them by pressing shift-space or 
ctrl-space.

Last note, make sure you have a version of vim installed that supports 
multibyte
characters and xim, if you type :version then you should see +multi_byte 
and +xim
somewhere in the list of things.

That's about all I can think of off the top of my head.  I don't speak 
anything but
English (well and a Spanish 101 level of Spanish).  You might try search 
google,
or looking through the vim help files... (vim has excellecent 
documentation).  I
would try something like :help xim or something.  With vim, if you see 
something
of the form |Topic| (like a word in vertical bars), you can use the 
arrows (or
j, k, l, and h) to move your cursor to the word and then press CTRL-], to
jump to that specific topic.  CTRL-o will bring you back to where you were.

--Ray




More information about the LUAU mailing list