注意:此文章默認您已安裝package control。javascript
一、JSHint (javascript語法檢查器)html
如圖:檢測出兩個errorjava
二、SublimeHighlight (自動高亮代碼文本轉換html文件,幫助快速構建自定義主題的代碼片斷)git
該插件提供了多種theme。github
autumn,
borland,
bw,
colorful,
default,
emacs,
friendly,
fruity,
manni,
monokai,
murphy,
native,
pastie,
perldoc,
rrt,
tango,
trac,
vim,
vs
實際效果以下:vim
自動生成部分,可經過setting - user中的noclasses控制是否使用行內樣式。具體看github測試
<div class="highlight" style="background: #111111"><pre style="line-height: 125%"><span style="color: #fb660a; font-weight: bold">var</span> <span style="color: #ffffff">str</span> <span style="color: #ffffff">=</span> <span style="color: #0086d2">"hello word"</span><span style="color: #ffffff">;</span> <span style="color: #fb660a; font-weight: bold">var</span> <span style="color: #ffffff">number</span> <span style="color: #ffffff">=</span> <span style="color: #0086f7; font-weight: bold">100</span><span style="color: #ffffff">;</span> <span style="color: #008800; font-style: italic; background-color: #0f140f">/**</span> <span style="color: #008800; font-style: italic; background-color: #0f140f"> * [Demo description]</span> <span style="color: #008800; font-style: italic; background-color: #0f140f"> * @param {[string]} pStr [測試用]</span> <span style="color: #008800; font-style: italic; background-color: #0f140f"> * @param {[number]} pNumber [測試用]</span> <span style="color: #008800; font-style: italic; background-color: #0f140f"> */</span> <span style="color: #fb660a; font-weight: bold">function</span> <span style="color: #ffffff">Demo(pStr,pNumber){</span> <span style="color: #ffffff">console.log(pStr,pNumber);</span> <span style="color: #ffffff">}</span> <span style="color: #ffffff">Demo(str,number);</span> </pre></div>
var str = "hello word";
var number = 100;
/**
* [Demo description]
* @param {[string]} pStr [測試用]
* @param {[number]} pNumber [測試用]
*/
function Demo(pStr,pNumber){
console.log(pStr,pNumber);
}
Demo(str,number);