Sublime Text 3 安裝 Package Control

來源:互聯網
上載者:User

標籤:

Sublime Text 3 安裝 Package Control
  • |

  • 瀏覽:2461

  • |

  • 更新:

    2014-04-26 18:07

自動安裝:

1、通過快速鍵 ctrl+` 或者 View > Show Console 菜單開啟控制台

2、粘貼對應版本的代碼後斷行符號安裝

適用於 Sublime Text 3:

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())

適用於 Sublime Text 2:

import  urllib2,os;pf=‘Package Control.sublime-package‘;ipp=sublime.installed_packages_path();os.makedirs(ipp)ifnotos.path.exists(ipp)elseNone;urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler()));open(os.path.join(ipp,pf),‘wb‘).write(urllib2.urlopen(‘http://sublime.wbond.net/‘+pf.replace(‘ ‘,‘%20‘)).read());print(‘Please restart Sublime Text to finish installation‘)

手動安裝:

第一步,先下載https://github.com/wbond/sublime_package_control中的zip檔案,解壓後將檔案夾名更改為package control。

第二步,下載外掛程式分支https://github.com/wbond/sublime_package_control/tree/python3中的zip檔案,解壓後覆蓋到package control中,完成此外掛程式API函數的更新。

最後,將package control檔案夾放入C:\Users\Mr.DenGo(你的電腦名)\AppData\Roaming\Sublime Text 3\Packages中,重啟sublime text 3即可生效。

sublime text 3常用外掛程式推薦:

ctrl+shift+p調用出視窗:輸入install package

然後輸入你想要的外掛程式即可:

BracketHighlighter高亮顯示匹配的括弧、引號和標籤

BracketHighlighter這個外掛程式能在左側高亮顯示匹配的括弧、引號和標籤,能匹配的[] ,  () ,  {} ,  "" ,  ‘‘ , <tag></tag>等甚至是自訂的標籤,當看到密密麻麻的代碼分不清標籤之間包容嵌套的關係時,這款外掛程式就能很好地幫你理清楚代碼結構,快速定位括弧,引號和標籤內的範圍。

外掛程式下載: https://github.com/facelessuser/BracketHighlighter/tree/BH2ST3

TrailingSpacer高亮顯示多餘的空格和Tab

有時候在代碼結尾打多了幾個空格或Tab,一般不會察覺,TrailingSpacer這款外掛程式能高亮顯示多餘的空格和Tab,並可以一鍵刪除它們,有代碼潔癖的朋友應該會喜歡這個外掛程式。

外掛程式下載: https://github.com/SublimeText/TrailingSpaces

注意,在github上下載的外掛程式缺少了一個設定快速鍵的檔案,可以建立一個名字和尾碼為Default (Windows).sublime-keymap的檔案,添加以下代碼,即可設定“刪除多餘空格”和“是否開啟TrailingSpacer ”的快速鍵了。

[
{ "keys":["ctrl+alt+d"], "command":"delete_trailing_spaces"},

{ "keys":["ctrl+alt+o"], "command":"toggle_trailing_spaces"}]

Alignment 等號對齊

按Ctrl+Alt+A,可以是淩亂的代碼以等號為準左右對其,適合有代碼潔癖的朋友。

外掛程式下載: https://github.com/kevinsperrine/sublime_alignment/tree/python3

Clipboard-history 粘貼板記錄

有了這個外掛程式,便可方便使用sublime text 3裡的粘貼板記錄內容,快速鍵Ctrl+Shift+V可調出該記錄面板,按方向鍵選擇想要粘貼的記錄。不過這是sublime text 2下的外掛程式,Ctrl+Shift+D清除粘貼板記錄好像不能生效,不過重啟sublime也可清除粘貼板的記錄。

外掛程式下載: https://github.com/kemayo/sublime-text-2-clipboard-history

SideBarEnhancements側邊欄增強

SideBarEnhancements本是增強側邊欄的外掛程式,這裡將教大家如何用來做sublime text 3瀏覽器預覽外掛程式,並可自訂瀏覽器預覽的快速鍵。

安裝此外掛程式,點擊工具列的preferences > package setting > side bar > Key Building-User,鍵入以下代碼,這裡設定按Ctrl+Shift+C複製檔案路徑,按F1~F5分別在firefox,chrome,IE,safari,opera瀏覽器預覽效果,當然你也可以自己定義喜歡的快速鍵,最後注意代碼中的瀏覽器路徑要以自己電腦裡的檔案路徑為準。

[
{ "keys":["ctrl+shift+c"], "command":"copy_path"},
//firefox
{ "keys":["f1"], "command":"side_bar_files_open_with",
"args":{
"paths":[],
"application":"C:\\software\\Browser\\Mozilla Firefox\\firefox.exe",
"extensions":".*"//匹配任何檔案類型
}},
//chrome
{ "keys":["f2"], "command":"side_bar_files_open_with",
"args":{
"paths":[],
"application":"C:\\Users\\Mr.DenGo\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
"extensions":".*"}},
//ie
{ "keys":["f3"], "command":"side_bar_files_open_with",
"args":{
"paths":[],
"application":"C:\\Program Files\\Internet Explorer\\iexplore.exe",
"extensions":".*"}},
//safari
{ "keys":["f4"], "command":"side_bar_files_open_with",
"args":{
"paths":[],
"application":"C:\\software\\Browser\\Safari\\safari.exe",
"extensions":".*"}},
//opera
{ "keys":["f5"], "command":"side_bar_files_open_with",
"args":{
"paths":[],
"application":"C:\\software\\Browser\\opera\\opera.exe",
"extensions":".*"}}]


Sublime Text 3 安裝 Package Control

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.