Sublime text2外掛程式

來源:互聯網
上載者:User

標籤:http   使用   os   strong   io   for   問題   cti   

Sublime外掛程式:

 Sublime有好幾種安裝外掛程式的方法,但是最好用也是最長用的是ctrl+shift+p。

第一步:

  使用ctrl+` 調出Sublime控制台,在控制台中輸入

      import urllib2,os;pf=‘Package Control.sublime-package‘;ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),‘wb‘).write(urllib2.urlopen(‘http://sublime.wbond.net/‘+pf.replace(‘ ‘,‘%20‘)).read())

第二步:

   重啟Sublime,使用快速鍵ctrl+shift+p,再輸入框中輸入Install Package

第三步:

   輸入你要安裝的外掛程式名,點擊enter就ok了,這時狀態列是會顯示正在安裝,當出現install successfully時就表示安裝成功了,如果安裝失敗可能是網路問題,多嘗試幾次。

 

 外掛程式能夠協助我們完成一些複雜的事情,簡化工作,下面是我在Sublime中安裝的幾個好用的外掛程式:

   1. docblocker

     自動注釋,jsdoc標準,輸入/**斷行符號即可,可以自訂一些注釋欄位,如:date,配置如下:

{                      

"jsdocs_extra_tags": ["@date {{date}}"],

"jsdocs_align_tags": "deep"

}

  2. Emmett

      自動完成HTML代碼,提高編寫頁面效率,按照文法寫完,在最後按tab鍵就可完成,文法參考:http://docs.emmet.io/abbreviations/syntax/

   3. alignment

       自動對齊代碼,比如json對象的冒號對齊,變數的等號對齊等,可以配置,快速鍵ctrl+alt+d,配置如下:

{
// The mid-line characters to align in a multi-line selection, changing
// this to an empty array will disable mid-line alignment
"alignment_chars": ["=",":",",","--"],

// If the following character is matched for alignment, insert a space
// before it in the final alignment
"alignment_space_chars": ["=",",",":","--"],

"jsdocs_extra_tags": ["@date {{date}}"]

}

    4. bracket highlighter

         高亮代碼匹配,可以匹配括弧,引號,標籤等

    5. js format

        js代碼格式化,可以使你的代碼看起來更漂亮,快速鍵ctrl+alt+f

    6.  Tag

         HTML代碼格式化,右鍵選擇auto-format tags on doucument

    7. sublimelinter

          支援lint文法的外掛程式,快速鍵ctrl+alt+l,當檢測出錯誤或者警告時會在行標處提示,可以設定什麼時候檢測,配置如下:

{

"sublimelinter":"save-only",//當儲存的時候檢測

}

      8. prefixr

           自動添加瀏覽器首碼,快速鍵ctrl+alt+x

       9. jQuery

            jquery代碼補全,快速鍵tab

 

如果你有好的外掛程式可以@我,繼續補充。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.