Chinaunix首页 | 论坛 | 博客
  • 博客访问: 428451
  • 博文数量: 114
  • 博客积分: 3361
  • 博客等级: 中校
  • 技术积分: 1060
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-18 13:14
文章分类

全部博文(114)

文章存档

2012年(1)

2011年(84)

2010年(29)

分类: LINUX

2011-01-20 16:20:37

刚装好ubuntu,emacs 不能使用 ibus 输入,也不能显示中文

后来google, 在 .bashrc 里面设置了


export LC_CTYPE=zh_CN.UTF-8


搞了半天,然后显示正常了,也能输入了

第二天,打开emacs,C+Space,又不管用了。。。。

偶然发现已神器: ibus-el

世界终于清净了



~ ~。。。


下面是引用:
===================================================================

System requirements


emacs22 or emacs23

python (>= 2.5)

ibus (>= 1.2)

python-xlib

Downloading


You can download ibus.el from

If you use Ubuntu Linux, you can install ibus-el package from

Installation

Manual Installation


Save ibus.el and byte-compile in a directory that is listed in load-path, and save ibus-el-agent somewhere in your system.

Put the following in your .emacs file:
        (require 'ibus)
        (add-hook 'after-init-hook 'ibus-mode-on)

If ibus.el and ibus-el-agent are saved in different directories, add a setting to the above as follows:
        (setq ibus-agent-file-name "/PATH/TO/ibus-el-agent")

Using deb package in PPA


Add ppa:irie/elisp to software sources:
        sudo add-apt-repository ppa:irie/elisp
        sudo apt-get update

and install ibus-el package:
        sudo apt-get install ibus-el

Put the following in your .emacs file:
        (require 'ibus)
        (add-hook 'after-init-hook 'ibus-mode-on)

Disabling XIM


If XIM is enabled, key events are directly handled by IBus so ibus.el can’t work.

To disable XIM in Emacs, put the following in ~/.Xresources file:
        Emacs*useXIM: false

and restart X session or execute a shell command:
        xrdb ~/.Xresources

Customize


Here is the example of .emacs file:
        (require 'ibus)
        ;; Turn on ibus-mode automatically after loading .emacs
        (add-hook 'after-init-hook 'ibus-mode-on)
        ;; Use C-SPC for Set Mark command
        (ibus-define-common-key ?\C-\s nil)
        ;; Use C-/ for Undo command
        (ibus-define-common-key ?\C-/ nil)
        ;; Change cursor color depending on IBus status
        (setq ibus-cursor-color '("red" "blue" "limegreen"))

You can customize keybinding which toggles input status:
        ;; Use s-SPC to toggle input status
        (global-set-key (kbd "s-SPC") 'ibus-toggle)

Using ibus-anthy


To toggle half-width eisu mode by C-j, add the following to .emacs:
        (ibus-define-common-key ?\C-j t)

To use kana input method with jp106 keyboard, you can enable kana onbiki (prolonged sound mark) key as follows:
        (setq ibus-use-kana-onbiki-key t)

If you use thumb shift input method, you have to specify the simultaneous pressing time as:
        (setq ibus-ibus-simultaneous-pressing-time 0.1)

Using ibus-chewing


Please set input style to “in application window” in ibus-chewing’s configuration dialog.

阅读(1771) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~