歡迎關(guān)注我的博客Zhuhao's Blog獲取最新文章
首先是安裝
添加sublime text 3的倉(cāng)庫(kù):
sudo add-apt-repository ppa:webupd8team/sublime-text-3
根據(jù)提示按ENTER 繼續(xù)窘俺,建立信任數(shù)據(jù)庫(kù)
更新軟件庫(kù)
sudo apt update
安裝Sublime Text 3
sudo apt install sublime-text-installer
等待軟件安裝成功……
安裝Packeage Control(這步開始出現(xiàn)問題)
第一種解決方法(在我這不成功)
在bash中輸入subl后猾愿,按ctrl + `,調(diào)出命令輸入窗口兵拢,然后輸入以下命令蠢涝。
import urllib.request,os,hashlib;
h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88';
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)
但是我這里嘗試這種方法不成功朽褪,調(diào)試信息如下:
File "./python3.3/urllib/request.py", line 1248, in do_open
File "./python3.3/http/client.py", line 1065, in request
File "./python3.3/http/client.py", line 1103, in _send_request
File "./python3.3/http/client.py", line 1061, in endheaders
File "./python3.3/http/client.py", line 906, in _send_output
File "./python3.3/http/client.py", line 844, in send
File "./python3.3/http/client.py", line 822, in connect
File "./python3.3/socket.py", line 435, in create_connection
File "./python3.3/socket.py", line 426, in create_connection
ConnectionRefusedError: [Errno 111] Connection refused
File "/home/dlyman/.config/sublime-text-3/Packages/tern_for_sublime/tern.py", line 264, in f
req = opener.open("http://" + localhost + ":" + str(port) + "/", json.dumps(doc).encode("utf-8"), 1)
File "./python3.3/urllib/request.py", line 469, in open
File "./python3.3/urllib/request.py", line 487, in _open
File "./python3.3/urllib/request.py", line 447, in _call_chain
File "./python3.3/urllib/request.py", line 1274, in http_open
File "./python3.3/urllib/request.py", line 1251, in do_open
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
手動(dòng)進(jìn)行安裝
需要從git下載Package Control主文件到~/.config/sublime-text-3/Packages/
cd ~/.config/sublime-text-3/Packages/
git clone https://github.com/wbond/package_control_channel.git Package\ Control
然后進(jìn)行下列步驟:
- 點(diǎn)擊Preferences > Browse Packages菜單
- 進(jìn)入打開的目錄的上層目錄健蕊,然后再進(jìn)入Installed Packages目錄
- 在 https://sublime.wbond.net/Package%20Control.sublime-package 下載
Package Control.sublime-package沦补,并將該文件復(fù)制到Installed Packages目錄 - 重啟Sublime Text
解決無(wú)法輸入中文問題
推薦的解決方法
- Update and then upgrade your system to the newest
sudo apt-get update && sudo apt-get upgrade
- 把這個(gè)repo克隆到你的電腦 :
git clone https://github.com/lyfeyaj/sublime-text-imfix.git
- 到
sublime-text-imfix
目錄:
cd sublime-text-imfix
- 運(yùn)行下面這條命令 :
./sublime-imfix
- Done! 重啟sublime即可完成
解決Sublime包管理Package Control 報(bào)錯(cuò) There Are No Packages Available For Installation
解決1:
網(wǎng)上說(shuō)是因?yàn)镮PV6的問題熊痴,導(dǎo)致無(wú)法訪問sublime的官網(wǎng),于是在host中添加如下對(duì)應(yīng)ip
#sublime
#50.116.34.243 sublime.wbond.net
如解決1沒有解決這個(gè)問題可以去 https://www.cnblogs.com/ae6623/p/5338049.html 查找其他解決方法