2015年10月18日 星期日

Sublime Text2 在Ubuntu下輸入中文

環境: Ubuntu 15.04使用gcin為中文輸入系統

在sublime text2下要輸入中文可藉由InputHelper

  1. 安裝package control: View -> Console下輸入
    import urllib2,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')

  2. 完成安裝後重開sublime text2, 使用ctrl + shift + p叫出package control並輸入install

  3. 輸入InputHelper, 安裝後需要再手動將它的權限設為可以執行,如下指令:

    chmod a+x ~/.config/sublime-text-2/Packages/InputHelper/lib/linux_text_input_gui.py

  4. 重新啟動sublime text, 按下 Ctrl + Shift + Z 會跳出輸入小視窗供你切換中文輸入法使用

Written with StackEdit.

沒有留言:

張貼留言