转载自:https://www.cnblogs.com/hupeng1234/p/6957623.html
1.安装方法
1)使用ppa安装
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer
卸载 sublime text 命令:
sudo apt-get remove sublime-text-installer
2)使用deb包安装
下载地址形如: https://download.sublimetext.com/files/sublime-text_build-版本号_amd64.deb
3126的下载地址为:https://download.sublimetext.com/files/sublime-text_build-3126_amd64.deb
不过貌似必须FQ才能下载
例如:
sudo dpkg -i sublime-text_build-3126_amd64.deb
- 通过apt安装[网络不稳定,可能需要多次尝试]
参考: http://www.sublimetext.com/docs/3/linux_repositories.html#apt
安装GPG key:
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
确保apt能够使用https源
sudo apt-get install apt-transport-https
使用稳定版源
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
更新apt源并安装sublime-text
sudo apt-get update
sudo apt-get install sublime-text
2. 打开命令
subl
3.在Help里输入license key(亲测可用)
----- BEGIN LICENSE -----
sgbteam
Single User License
EA7E-1153259
8891CBB9 F1513E4F 1A3405C1 A865D53F
115F202E 7B91AB2D 0D2A40ED 352B269B
76E84F0B CD69BFC7 59F2DFEF E267328F
215652A3 E88F9D8F 4C38E3BA 5B2DAAE4
969624E7 DC9CD4D5 717FB40C 1B9738CF
20B3C4F1 E917B5B3 87C38D9C ACCE7DD8
5F7EF854 86B9743C FADC04AA FB0DA5C0
F913BE58 42FEA319 F954EFDD AE881E0B
------ END LICENSE ------
4.安装Packeage Control
可参考: https://packagecontrol.io/installation
在终端输入subl打开sublime text3, 使用快捷键ctrl + `(ESC下面的键),在弹出的控制台中输出以下代码:
import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; 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)
5.重启软件后可以在Preference菜单下找到Package Control命令
单击运行Packeage Control,搜索Install Package并进入该选项,此时即可为Sublime Text 3安装所需插件
6.关闭自动更新
Preferences -> Settings-User,在{}输入 ,"update_check":false
7.设置一个tab键对应4个空格
Preferences -> Settings-User,在{}输入
"tab_size": 4,
"translate_tabs_to_spaces": true
8.解决中文无法输入问题
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,此时就可以输入中文了
//----------------------------------------------------------------------------
彻底卸载sublime-text
sudo apt-get remove --purge sublime-text
sudo apt-get autoremove
删除配置文件
sudo rm -rf /opt/sublime_text/
rm -rf ~/.config/sublime-text-3/
查找相关文件并手动删除
sudo find / -name sublime*
sudo updatedb
locate sublime-text
](javascript:void(0); "复制代码")