I would like to type Chinese in Emacs
. I followed this link, and tried several input methods including chinese-py
. It seems that, unlike normal IME of an operation system, it is not possible to type more than 1 character one time. We have to type character 1 by 1, this is not convenient at all.
Does anyone have a solution?
You can use
ibus
withemacs
(22 or higher) by installingibus-el
.ibus-el or
sudo apt-get install ibus-el
There are instructions for setting it up at Ibus Mode. The instructions were written when
ibus-el
was still a PPA, but the rest of it holds. Slightly updated instructions are also installed to/usr/share/doc/ibus-el
If you have installed
ibus-el
, you can ignore most of the instructions. All you need to do is add the following lines to your~/.emacs
file:Something not mentioned in the manual is that Ibus is not listed as in input method in Emacs even after installing
ibus-el
. So there's no need to bother withC-\
. Just use the Ibus indicator on the menubar to switch input methods like you would with any other application.Also, Ibus won't see an available input window immediately after Emacs has started. If you try to switch to a Chinese input method at that point using the Ibus indicator on the menu bar, nothing will happen and you might think it's not working. But just click in your file before trying to switch the input method (letting Ibus see the available edit window) and then menu bar indicator and Ibus work as normal.
I use fcitx. It works very well in emacs. But to make the shortcut
Ctrl+Space
work, you have to use the commandenv LC_CTYPE=zh_CN.UTF-8 emacs
to start emacs.