ubuntu下安装sublime text3中文补丁


新建c语言文件sublime_imfix.c,编译成libsublime-imfix.so,编译过程:
sudo apt-get install build-essential
sudo apt-get install libgtk2.0-dev
gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC

拷贝到Sublime Text 3目录下(默认在/opt/sublime_text下)
编辑subl命令文件:/usr/bin/subl
#!/bin/sh
export LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so
exec /opt/sublime_text/sublime_text "$@"

编辑/usr/share/applications/sublime_text.desktop文件,将里面的/opt/sublime_text/sublime_text换成subl