一、从命令行启动
git clone https://github.com/lyfeyaj/sublime-text-imfix.git
cd ~/sublime-text-imfix
这里进入的从github下载下来的文件夹,我直接在主目录clone的,所以直接进入~/sublime-text-imfix
sudo cp ./lib/libsublime-imfix.so /opt/sublime_text/
sudo cp ./src/subl /usr/bin/
补充一句,测试一下,如果可以,就可以删除下载的文件了。
二、右键打开方式
此方式建立在上述方式上
sudo gedit /usr/share/applications/sublime_text.desktop
内容如下
[Desktop Entry] Version=1.0 Type=Application Name=Sublime Text GenericName=Text Editor Comment=Sophisticated text editor for code, markup and prose Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text %F" Terminal=false MimeType=text/plain; Icon=sublime-text Categories=TextEditor;Development; StartupNotify=true Actions=Window;Document; [Desktop Action Window] Name=New Window Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text -n" OnlyShowIn=Unity; [Desktop Action Document] Name=New File Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text --command new_file" OnlyShowIn=Unity;