sublime外掛程式(配合nodejs環境)

來源:互聯網
上載者:User

標籤:html   default   外掛程式   search   ges   快速鍵   show   time   err   

一、首先先安裝nodejs,從nodejs官網下載 www.nodejs.cn 

下載完成後直接安裝,選擇npm package版本的進行安裝,安裝完成後無需配置環境變數,nodejs會自動進行配置。

開啟cmd命令列,輸入node -v,顯示v4.4.4,說明安裝成功。

二、安裝HTML/CSS/JS Prettify外掛程式,該外掛程式可以格式化HTML、CSS、JS檔案,但是依賴node環境。

1、sublime中ctrl+shift+p調出命令列,輸入prettify,找到相應外掛程式安裝。安裝完成後,ctrl+shift+H快速鍵即可以格式檔案。

三、安裝sublimeliner、sublimeliner-jshint外掛程式,該外掛程式可以提示js語法錯誤,也是依賴node環境。如今sublimeliner已經是第三個版本了,安裝該外掛程式就會自動附帶sublimeliner-jshint外掛程式。

1、sublime中ctrl+shift+p調出命令列,輸入sublimeliner,找到相應外掛程式安裝。

2、nodejs需要添加jshint依賴,開啟命令列,輸入npm install -g jshint,這時就會自動下載該依賴。

3、這時就可以對外掛程式進行一些設定了,具體設定可以參考sublimeliner官網 http://www.sublimelinter.com/en/latest/

{    "user": {        "debug": false,        "delay": 0.25,        "error_color": "D02000",        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",        "gutter_theme_excludes": [],        "lint_mode": "background",        "linters": {            "coffeejshint": {                "@disable": false,                "args": [],                "excludes": [],                "globals": "",                "options": "browser,devel,node"            },            //js的提示設定            "jshint": {                "@disable": false,                "args": [],                "browser": true,                "curly": true,                "devel": true,                "eqeqeq": true,                "evil": true,                "excludes": [],                "forin": true,                "jquery": true,                "noarg": true,                "noempty": true,                "strict": true,                "undef": true,                "wsh": true            }        },        //標記風格,可以從官網上查看        "mark_style": "squiggly underline",        "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",        "syntax_map": {            "html (django)": "html",            "html (rails)": "html",            "html 5": "html",            "javascript (babel)": "javascript",            "magicpython": "python",            "php": "html",            "python django": "python",            "pythonimproved": "python"        },        "warning_color": "DDB700",        "wrap_find": true    }}

  儲存後,查看效果如下:

 

sublime外掛程式(配合nodejs環境)

聯繫我們

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