sublime text3配置

1、下載sublime text3

進入官方網站進行下載javascript

2、安裝插件

1. Package Control

做爲安裝 Sublime Text 插件的必備利器,Package Control 是這款編輯器的標配,能夠方便開發人員快速安裝須要的插件。Package Control分爲命令行安裝和下載安裝包安裝,詳細流程見https://packagecontrol.io/installationphp

2. Emmet

Emmet 項目的前身是前端開發人員熟知的 Zen Coding(快速編寫 HTML/CSS 代碼的方案)。在 Sublime Text 編輯器中搭配 Emmet 插件真的是讓你編碼快上加快。css

3. SublimeCodeIntel

SublimeCodeIntel 是一個代碼提示、補全插件,支持多種語言,還能跳轉到變量、函數定義的地方,十分方便。html

默認js的提示爲jquery,若須要支持其餘的,能夠將Preferences->Package Settings->SublimeCodeIntel->Setting Default,將其內容所有複製到Setting User中,並修改
"codeintel_selected_catalogs": ["jQuery","HTML5", "HTML", "JavaScript"]前端

若須要額外配置,則需安裝相應程序並把路徑寫入 ~/.codeintel/config 或 project_root.codeintel/configz中。詳見packagecontrol。經過packet control下載安裝好SublimeCodeInter插件以後,經過preference-->browse packages找到插件SublimeCodeInter的路徑以後,找不到 .codeintel/config 目錄解決方法:windows環境下經過cmd進入dos環境,使用mkdir .codeintel創建了一個名爲「.codeintel」的文件夾,在.condeintel/config下面建立一個config配置文件,內容例如:java

{
"PHP": {
    "php": '/usr/bin/php',
    "phpExtraPaths": [],
    "phpConfigFile": 'php.ini'
},
"JavaScript": {
    "javascriptExtraPaths": []//寫上路徑
}
}

4. HTML-CSS-JS Prettify

HTML-CSS-JS Prettify可用於格式化 HTML, CSS, JavaScript和JSON代碼。使用該插件前需先安裝node.js。安裝好該插件後,點擊Preferences->Package Settings->HTML-CSS-JS Prettify->Set Node Path設置node.js的安裝路徑。可參見node

5. BracketHighlighter

BracketHighlighter這個插件功能是匹配括號,在行號前面能夠看到匹配括號的位置。python

6. SublimeLinter

SublimeLinter至關於一個插件容器,能夠容納許多linter插件,如SublimeLinter-jshint、SublimeLinter-csslint。進行代碼檢查的其實是jshint與csslint這些代碼檢查工具。jquery

  1. 安裝SublimeLinterlinux

  2. 將htmlhint、jshint與csslint三個模塊安裝到全局環境
    在控制檯運行:npm install -g htmlhintnpm install -g jshintnpm install -g csslint。可經過輸入csslint --version和jshint -v來確認csslint和jshint是否安裝成功。

  3. 使用Package Control安裝SublimeLinter-contrib-htmlhint、SublimeLinter-jshint 與 SublimeLinter-csslint插件

  4. 配置文件
    Preferences > Package Settings > SublimeLinter > Settings – User文件裏面配置參數(若想修改錯誤提示的圖形,可經過Tools-> SublimeLinter > Choose Gutter Theme... 進行修改,詳見)

    {
     "user": {
        "sublimelinter": "save-only",
        "sublimelinter_popup_errors_on_save": true,
        "sublimelinter_executable_map": {
            "javascript": "D:/Program Files/nodejs/node.exe",
            "css": "D:/Program Files/nodejs/node.exe"
        },
        "jshint_options": {
        "strict": false,
        "quotmark": "single", //只能使用單引號
        "noarg": true,
        "noempty": true, //不容許使用空語句塊{}
        "eqeqeq": true, //!==和===檢查
        "undef": true,
        "curly": true, //值爲true時,不能省略循環和條件語句後的大括號
        "forin": true, //for in hasOwnPropery檢查
        "devel": true,
        "jquery": true,
        "browser": true,
        "wsh": true,
        "evil": true,
        "unused": "vars", //形參和變量未使用檢查
        "latedef": true, //先定義變量,後使用
        "globals": {
            "grunt": true,
            "module": true,
            "window": true,
            "jQuery": true,
            "$": true,
            "global": true,
            "document": true,
            "console": true,
            "setTimeout": true,
            "setInterval": true
        }
    },
    "csslint_options": {
        "adjoining-classes": false,
        "box-sizing": false,
        "box-model": 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/Blueberry/cross/Blueberry - cross.gutter-theme",
        "gutter_theme_excludes": [],
        "lint_mode": "background",
        "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,
        "syntax_map": {
            "python django": "python",
            "pythonimproved": "python",
            "magicpython": "python",
            "html 5": "html",
            "html (django)": "html",
            "html (rails)": "html",
            "javascript (babel)": "javascript",
            "php": "html"
        },
        "warning_color": "DDB700",
        "wrap_find": true
    }
    }
相關文章
相關標籤/搜索