安裝Package Controljavascript
Sublime安裝插件有兩種方式,一種是直接下載安裝包解壓縮到Packages目錄,另外一種是經過Package Control組件來安裝組件,後者更加的方便。php
打開Sublime,按control + ` 打開控制檯,粘貼以下代碼到命令行並回車;css
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,在Perferences->Package Settings 中看到 Package Control,則表示安裝成功。html
安裝SublimeLinterjava
SublimeLinter是Sublime的一個代碼檢測工具插件。
安裝SublimeLinter前必須安裝node.jsnode
打開Sublime,按下 Ctrl+Shift+p 進入 Command Palette;python
輸入install進入 Package Control: Install Package;jquery
輸入SublimeLinter,選擇SublimeLinter進行安裝。linux
安裝sublimeLinter-contrib-htmlhintgit
能夠把sublimeLinter-contrib-htmlhint當作是SublimeLinter的一個插件,sublimeLinter-contrib-htmlhint調用xg-htmlhint來進行語法檢查。sublimeLinter-contrib-htmlhint 1.0.1版本有問題,因此咱們使用1.0.0版本。
前往Releases下載1.0.0的壓縮包,解壓並重命名爲「SublimeLinter-contrib-htmlhint」,並放入Sublime的Package目錄(菜單->Preferences->Browse
Packages)
找到node.js的CMD窗口,輸入如下命令;等待出現一堆數字版本號即爲成功安裝。
npm install -g xg-htmlhint
此時打開Sublime Text3,xg-htmlhint就能夠檢測代碼了,保存(cmd + S)的時候若是有錯誤會有錯誤提示。
安裝jshint和csslint
打開Sublime_Txt3,按住Ctrl+Shift+P安裝
SublimeLinter-csslint SublimeLinter-jshint
打開nodejs的CDM窗口,輸入命令安裝
npm install jshint npm install csslint
SublimeLinter個性化配置
{ "user": { "csslint_options": { "adjoining-classes": false, "box-model": false, "box-sizing": false, "compatible-vendor-prefixes": false, "floats": false, "font-sizes": false, "gradients": false, "important": false, "known-properties": false, "outline-none": false, "qualified-headings": false, "regex-selectors": false, "shorthand": false, "text-indent": false, "unique-headings": false, "universal-selector": false, "unqualified-attributes": false }, "debug": false, "delay": 0.25, "error_color": "D02000", "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme", "gutter_theme_excludes": [], "jshint_options": { "browser": true, "curly": true, "devel": true, "eqeqeq": true, "evil": true, "forin": true, "globals": { "$": true, "console": true, "document": true, "global": true, "grunt": true, "jQuery": true, "module": true, "setInterval": true, "setTimeout": true, "window": true }, "jquery": true, "latedef": true, "noarg": true, "noempty": true, "quotmark": "single", "strict": false, "undef": true, "unused": "vars", "wsh": true }, "lint_mode": "background", "linters": { "csslint": { "@disable": false, "args": [], "errors": "", "excludes": [], "ignore": "", "warnings": "" }, "htmlhint": { "@disable": false, "args": [], "excludes": [] }, "jshint": { "@disable": false, "args": [], "excludes": [] } }, "mark_style": "outline", "no_column_highlights_line": false, "passive_warnings": false, "paths": { "linux": [], "osx": [], "windows": [] }, "python_paths": { "linux": [], "osx": [], "windows": [] }, "rc_search_limit": 3, "shell_timeout": 10, "show_errors_on_save": false, "show_marks_in_minimap": true, "sublimelinter": "save-only", "sublimelinter_executable_map": { "css": "C:/Program Files/nodejs/node.exe", "javascript": "C:/Program Files/nodejs/node.exe" }, "sublimelinter_gutter_marks": true, "sublimelinter_popup_errors_on_save": true, "syntax_map": { "html (django)": "html", "html (rails)": "html", "html 5": "html", "javascript (babel)": "javascript", "magicpython": "python", "php": "html", "python django": "python" }, "warning_color": "DDB700", "wrap_find": true } }