sublime text3 linux下中文支持

安装 C/C++ 的编译环境和 gtk libgtk2.0-dev

sudo apt-get install build-essential
sudo apt-get install libgtk2.0-dev

不要忘了把 libsublime-imfix.so 放到 /opt/sublime_text/ 中

编译共享内库

gcc -shared -o libsublime-imfix.so sublime-imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC

修改 /usr/share/applications/sublime_text.desktop

[Desktop Entry]
[...]
Exec=env LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so /opt/sublime_text/sublime_text %F
[...]

[Desktop Action Window]
[...]
Exec=env LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so /opt/sublime_text/sublime_text -n
[...]

[Desktop Action Document]
[...]
Exec=env LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so /opt/sublime_text/sublime_text --command new_file
[...]

修改 /usr/bin/subl 为

!/bin/sh

export LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so
exec /opt/sublime_text/sublime_text "$@"

你可能感兴趣的:(linux/unix)