Sublime Text安裝步驟

ChericeYang發表於2018-06-02
sumlime配置
import urllib.request,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();urllib.request.install_opener(urllib.request.build_opener(urllib.request.ProxyHandler()));open(os.path.join(ipp,pf),'wb').write(urllib.request.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())

快捷鍵ctrl+` 或者View->Show Console,輸入如下程式碼(sublime text3)

import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; 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://sublime.wbond.net/' + 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)

或者下面的程式碼

import urllib.request,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();urllib.request.install_opener(urllib.request.build_opener(urllib.request.ProxyHandler()));open(os.path.join(ipp,pf),'wb').write(urllib.request.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())

可是自動安裝的方法沒成功,下面說手動的

2、瀏覽器輸入 https://sublime.wbond.net/Package%20Control.sublime-package

從這裡下載這個檔案

下載好以後,開啟sublime text3,選擇選單Preferences->Browse Packages... 開啟安裝目錄,

此時會進入到一個叫做Packages的目錄下,點選進入上一層目錄Sublime Text3,在此目錄下有一個資料夾叫做Installed Packages,把剛才下載的檔案放到這裡就可以了。然後重啟sublime text3,觀察Preferences選單最下邊是否有Package Settings 和Package Control兩個選項,如果有,則代表安裝成功了。此時使用快捷鍵Ctrl+Shift+P,輸入install,選擇install package,想安裝什麼外掛,在裡面搜尋名字就可以了。

1、開啟packageControl 對應快捷鍵 command + shift + p
2、輸入install package
3、安裝外掛 SideBarEnhancements
4、開啟Settings-Default

5、找到:"default_browser": "", //one of this list: firefox, chrome, canary, chromium, opera, safari, ie
6、再開啟Settings-User 新增 {
"default_browser": "chrome", //one of this list: firefox, chrome, canary, chromium, opera, safari, ie
}
7、開啟KeyBings 右側新增 {
"keys": ["command+r"], "command": "open_in_browser"
},
{
"keys": ["command+/"],"command": "toggle_side_bar"
}
前提是已經安裝了open_in_browser的外掛

相關文章