Ubuntu16.04 下安装Sublime Text 3
1. 添加Sublime-text-3软件包的软件源
sudo add-apt-repository ppa:webupd8team/sublime-text-3
2. 更新系统软件源
sudo apt-get update
3. 安装Sublime-text-3
sudo apt-get install sublime-text-installer
4. 命令行启动
subl
5. 安装package control
打开Sublime Text3,按下快捷键【Ctrl】+【``】(左上角第二排第一个键)或者【
View】->【Show Console】调出输入框,然后粘贴下面的代码到输入框里面即可完成Package Control安装:
import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
6. 解决无法输入中文问题
git clone https://github.com/lyfeyaj/sublime-text-imfix.git cd sublime-text-imfix/ sudo cp lib/libsublime-imfix.so /opt/sublime_text/ sudo cp src/subl /usr/bin/
关闭sublime的所有窗口,然后在终端输入subl就可以输入中文。特别说明:只能是通过subl命令打开的sublime才能输入中文!