无法输入中文
git https://github.com/lyfeyaj/sublime-text-imfix
忽略编译(已编译)
sublime-imfix.c
下面命令编译生成 libsublime-imfix.so
1 | gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC |
copy安装目录
1 | sudo mv libsublime-imfix.so /opt/sublime_text/ |
命令行启动输入中文
/usr/bin/subl
1 | exec /opt/sublime_text/sublime_text "$@" |
菜单栏打开输入中文
修改文件sublime_text.desktop的内容
将[Desktop
Entry]中的字符串
Exec=/opt/sublime_text/sublime_text %F
修改为
1 | Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text %F" |
将[Desktop Action Window]中的字符串
Exec=/opt/sublime_text/sublime_text -n
修改为
1 | Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text -n" |
将[Desktop Action Document]中的字符串
Exec=/opt/sublime_text/sublime_text –command new_file
修改为
1 | Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text --command new_file" |
中文界面
https://packagecontrol.io/installation#Simple
下载 Package
Control.sublime-package https://packagecontrol.io/Package%20Control.sublime-package
点击
进入目录软件
Download Package
Control.sublime-package and copy it into the Installed
Packages/ directory重启生效
点击Preferences/Package
Control,然后输入Package Control:Install Package然后在弹出的命令界面,输入Chinese,选择ChineseLocalization
安装成功