Sublime Text 3 : Package Control

Sublime Text 3 : Package Control

標簽(空格分隔): SublimeText3


![https://packagecontrol.io/][1]
[1]:https://packagecontrol.io/img/logo.svg

Installation - Package Control

Installation

Manual

If for some reason the console installation instructions do not work for you (such as having a proxy on your network), perform the following steps to manually install Package Control:

  • Click the Preferences > Browse Packages… menu
  • Browse up a folder and then into the Installed Packages/ folder
  • Download Package Control.sublime-package and copy it into the Installed Packages/ directory
  • Restart Sublime Text

Simple

The simplest method of installation is through the Sublime Text console. The console is accessed via the ctrl+` shortcut or the View > Show Console menu. Once open, paste the appropriate Python code for your version of Sublime Text into the console.

Sublime Text 3:

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) 

Sublime Text 2:

import urllib2,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; 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') 

This code creates the Installed Packages folder for you (if necessary), and then downloads the Package Control.sublime-package into it. The download will be done over HTTP instead of HTTPS due to Python standard library limitations, however the file will be validated using SHA-256.

Usage

Basic Functionality

?Package Control is driven by the Command Palette. To open the palette, press ctrl+shift+p (Win, Linux) or 'cmd+shift+p' (OS X). All Package Control commands begin with Package Control:, so start by typing Package.

The command palette will now show a number of commands. Most users will be interested in the following:

Install Package

Show a list of all available packages that are available for install. This will include all of the packages from the default channel, plus any from repositories you have added.

Add Repository

Add a repository that is not included in the default channel. This allows users to install and automatically update packages from GitHub and BitBucket. To add a package hosted on GitHub, enter the URL in the form https://github.com/username/repo or https://github.com/bani/SublimeFormatSQL. Don’t include .git at the end! BitBucket repositories should use the format https://bitbucket.org/username/repository.

Remove Package

This removes the package folder, and the package name from the installed_packages list in Packages/User/Package Control.sublime-settings. The installed_packages list allow Package Control to automatically install packages for you if you copy your Packages/User/ folder to another machine.

By default Package Control checks for new versions on startup. This setting, plus the list of channels and repositories are managed through the Settings.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末周霉,一起剝皮案震驚了整個濱河市责静,隨后出現(xiàn)的幾起案子锁右,更是在濱河造成了極大的恐慌逛揩,老刑警劉巖淤袜,帶你破解...
    沈念sama閱讀 222,252評論 6 516
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件踱讨,死亡現(xiàn)場離奇詭異峭梳,居然都是意外死亡,警方通過查閱死者的電腦和手機虱而,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,886評論 3 399
  • 文/潘曉璐 我一進店門筏餐,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人牡拇,你說我怎么就攤上這事魁瞪。” “怎么了诅迷?”我有些...
    開封第一講書人閱讀 168,814評論 0 361
  • 文/不壞的土叔 我叫張陵佩番,是天一觀的道長众旗。 經(jīng)常有香客問我罢杉,道長,這世上最難降的妖魔是什么贡歧? 我笑而不...
    開封第一講書人閱讀 59,869評論 1 299
  • 正文 為了忘掉前任滩租,我火速辦了婚禮赋秀,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘律想。我一直安慰自己猎莲,他們只是感情好,可當我...
    茶點故事閱讀 68,888評論 6 398
  • 文/花漫 我一把揭開白布技即。 她就那樣靜靜地躺著著洼,像睡著了一般。 火紅的嫁衣襯著肌膚如雪而叼。 梳的紋絲不亂的頭發(fā)上身笤,一...
    開封第一講書人閱讀 52,475評論 1 312
  • 那天,我揣著相機與錄音葵陵,去河邊找鬼液荸。 笑死,一個胖子當著我的面吹牛脱篙,可吹牛的內(nèi)容都是我干的娇钱。 我是一名探鬼主播,決...
    沈念sama閱讀 41,010評論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼绊困,長吁一口氣:“原來是場噩夢啊……” “哼文搂!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起秤朗,我...
    開封第一講書人閱讀 39,924評論 0 277
  • 序言:老撾萬榮一對情侶失蹤细疚,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后川梅,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體疯兼,經(jīng)...
    沈念sama閱讀 46,469評論 1 319
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,552評論 3 342
  • 正文 我和宋清朗相戀三年贫途,在試婚紗的時候發(fā)現(xiàn)自己被綠了吧彪。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 40,680評論 1 353
  • 序言:一個原本活蹦亂跳的男人離奇死亡丢早,死狀恐怖姨裸,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情怨酝,我是刑警寧澤傀缩,帶...
    沈念sama閱讀 36,362評論 5 351
  • 正文 年R本政府宣布,位于F島的核電站农猬,受9級特大地震影響赡艰,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜斤葱,卻給世界環(huán)境...
    茶點故事閱讀 42,037評論 3 335
  • 文/蒙蒙 一慷垮、第九天 我趴在偏房一處隱蔽的房頂上張望揖闸。 院中可真熱鬧,春花似錦料身、人聲如沸汤纸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,519評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽贮泞。三九已至,卻和暖如春幔烛,著一層夾襖步出監(jiān)牢的瞬間隙畜,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,621評論 1 274
  • 我被黑心中介騙來泰國打工说贝, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留议惰,地道東北人。 一個月前我還...
    沈念sama閱讀 49,099評論 3 378
  • 正文 我出身青樓乡恕,卻偏偏與公主長得像言询,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子傲宜,可洞房花燭夜當晚...
    茶點故事閱讀 45,691評論 2 361

推薦閱讀更多精彩內(nèi)容