完美解决Ubuntu下Sublime Text 2中文输入(Fcitx)

技术分享

sudo apt-get install build-essential libgtk2.0-dev
gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC

sublime_text.sh
#!/bin/bash
sh -c "LD_PRELOAD=/home/eechen/apps/sublime_text_2/libsublime-imfix.so /home/eechen/apps/sublime_text_2/sublime_text"

sublime_text.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=sublime_text
Icon=/home/eechen/apps/sublime_text_2/Icon/48x48/sublime_text.png
Exec=sh -c "LD_PRELOAD=/home/eechen/apps/sublime_text_2/libsublime-imfix.so /home/eechen/apps/sublime_text_2/sublime_text"
Comment[zh_CN]=Sublime Text 2

Sublime Text 用户配置文件
Linux: ~/.config/sublime-text-2
Windows: %APPDATA%\Sublime Text 2

设置字体为DejaVu Sans Mono:
菜单Preferences - Settings User内容:
{
    "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
    "font_size": 12,
    "font_face": "DejaVu Sans Mono"
}

Windows上右键快捷菜单注册表:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\OpenWithSublimeText]
@="Open with Sublime Text"
"Icon"="D:\\Sublime Text 2\\sublime_text.exe"
[HKEY_CLASSES_ROOT\*\shell\OpenWithSublimeText\command]
@="\"D:\\Sublime Text 2\\sublime_text.exe\" \"%1\""

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。