bsp的选择

emacs and fcitx

zoro posted @ 2011年6月06日 17:01 in World with tags fcitx emacs FREEBSD linux , 8205 阅读

 fcitx运行的编码环境是zh_CN.UTF-8或者en_US.UTF-8,但是zh_CN.UTF-8存在的问题是在字符终端下很多程序会显示乱码,比如vim,所以自己设置了编码环境为en_US.UTF-8,这样既可以用fcitx,也可以在没有图形界面的时候轻松一点,但随之而来的让人头疼的问题是emacs中无法用fcitx,网上搜了很久,始终解决不了,不论是在linux或是freebsd下,这都很让人头疼。

 最终发现emacs中使用fcixt需LC_CTYPE设置为zh_CN.UTF-8,比如在shell中:

LC_CTYPE=zh_CN.UTF-8 emacs

 启动emacs后就可以使用fcitx了,但是这样输入很麻烦,虽然可以在shell的配置文件中用alias设置

alias emacs='LC_CTYPE=zh_CN.UTF-8 emacs'

这样在shell中启动emacs时会方便些,但是在用fbrun或是gmrun来启动emacs可就无效了。

我用openbox,所以直接给emacs设置了快捷键,但是在配置文件中使用LC_CTYPE=zh_CN.UTF-8 emacs是无法运行的,

好在有个命令env,可以用它来给emacs绑定快捷键,在rc.xml中绑定快捷键是设置为:

<execute>env LC_CTYPE=zh_CN.UTF-8 emcas</execute>

这样就可以通过快捷键来启动emacs,在emacs使用fcitx了。重点是env来改变运行环境,至于在openbox或是别的图形环境下估计就大同小异了。这在linux或是freebsd中一样的,在slackware13.37和freebsd8.2中是可以的。

Avatar_small
Mike Ma 说:
2011年6月11日 18:21

sudo mv /usr/bin/emacs{,.raw}
sudo cat >> /usr/bin/emacs << EOF
./emacs.raw "$@"
EOF

Avatar_small
Mike Ma 说:
2011年6月11日 18:22

呃,把中间的./emacs.raw "$@"替换为LC_CTYPE=zh_CN.UTF-8 emacs.raw,这样不管在哪个环境下,即使是kde/gnome或者xfce下,不用配置也可以了。

Avatar_small
zoro 说:
2011年6月16日 22:48

不错的建议,谢谢喽

bluebird 说:
2011年9月28日 23:33

非常棒的解决方案。Wonderful.

ESIC online payment 说:
2022年8月06日 22:48

Insurance has become a vital enrollment for all employees in this age and the state governments in India have provided their employees with various schemes that allow them to find themselves good plans from the state government itself, and one of the finest options of this is the security provided since the Insurance is provided by the State Government. ESIC online payment In this context, if employee opted for Employee state insurance, then you will have to pay monthly contributions towards insurance. This monthly ESI contribution deducts from the employee or the employee can choose to pay at their appropriate times.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter