Sublime中文

无法输入中文

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
2
3
exec /opt/sublime_text/sublime_text "$@"    
替换为
LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so 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

点击 Preferences > Browse
Packages

进入目录软件

  1. Download Package
    Control.sublime-package
    and copy it into the Installed
    Packages/ directory

  2. 重启生效

  3. 点击Preferences/Package
    Control,然后输入Package Control:Install Package

  4. 然后在弹出的命令界面,输入Chinese,选择ChineseLocalization

  5. 安装成功

点击打赏
文章目录
  1. 1. 无法输入中文
  2. 2. 命令行启动输入中文
  3. 3. 菜单栏打开输入中文
载入天数...载入时分秒... ,