Get the source from here, it should be the most complete one (with cursor follow fix): https://github.com/lyfeyaj/sublime-text-imfix , then just follow the guide to install (no need to compile)
If you want to DO IT BY YOURSELF, then follow the instructions below:
- COPY the src code from the link above (the sublime-imfix.c file), save as
sublime-imfix.c
, whatever. - Install the gtk2 build tools.
- Compile the code :
gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC
- Copy the .so lib to /opt/sublime_text
- Update
subl
in /usr/bin/ with following contents:
#!/bin/sh
export LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so
exec /opt/sublime_text/sublime_text "$@"
# The '$@' sign here is important, for direct open file by double clicking file icon
Since the imfix .so lib is compile with gtk2, if you use Terminal plugin or call a terminal (e.g. SAKURA) from build system, it will be fail and system will notify you gtk2 and gtk3 lib cannot be used in same process.
Open config of Terminal plugin Terminal.sublime-settings
, add :
"env": {"LD_PRELOAD": null} // Unset LD_PRELOAD because it may cause problems for sublime with imfix
Reference :
https://www.zhihu.com/question/39397539
http://html5beta.com/page/ubuntu-14-04-install-fcitx-sougoupinyin-sublime-text-3-chinese-input-fix.html