Visual Studio Code 使用總結


  記錄一下我的在使用 VS Code 中的一些插件和設置。javascript

  該配置在編寫 vue + iview 項目時使用。html


文件路徑

  • 用戶文件路徑:%AppData%/Code/User
  • 用戶設置:settings.json

用戶設置以下

{
  /* 編輯器:開始 */
  // 控制字體系列。
  "editor.fontFamily": "Monaco",
  // 控制編輯器在鍵入一行後是否自動格式化該行。
  "editor.formatOnType": true,
  // 以像素爲單位控制字符間距。
  "editor.letterSpacing": 0.618,
  // 控制是否顯示小地圖。
  "editor.minimap.enabled": false,
  // 控制是否在鍵入時自動顯示建議。
  "editor.quickSuggestions": {
    "other": true,
    "comments": true,
    "strings": true
  },
  // 一個製表符等於的空格數。
  // 在 `editor.detectIndentation` 啓用時,根據文件內容,該設置可能會被覆蓋。
  "editor.tabSize": 2,
  // 控制折行的方式。
  //  - off: 永不換行。
  //  - on: 將在視區寬度處換行。
  //  - wordWrapColumn: 在 `editor.wordWrapColumn` 處折行。
  //  - bounded: 在視區寬度和 `editor.wordWrapColumn` 中的較小值處折行。
  "editor.wordWrap": "on",
  /* 編輯器:結束 */

  /* 工做臺:開始 */
  // 指定在工做臺中使用的圖標主題,或指定 "null" 以不顯示任何文件圖標。
  //  - null: 無文件圖標
  //  - vs-minimal
  //  - vs-seti
  //  - material-icon-theme
  "workbench.iconTheme": "material-icon-theme",
  /* 工做臺:結束 */

  /* 文件:開始 */
  // 控制已更新文件的自動保存。可在[此處](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save)閱讀有關自動保存的詳細信息。
  //  - off: 永不自動保存更新後的文件。
  //  - afterDelay: 當文件修改後的時間超過 `files.autoSaveDelay` 中配置的值時自動進行保存。
  //  - onFocusChange: 編輯器失去焦點時自動保存更新後的文件。
  //  - onWindowChange: 窗口失去焦點時自動保存更新後的文件。
  "files.autoSave": "afterDelay",
  /* 文件:結束 */

  /* 集成終端:開始 */
  // 控制終端的字體系列,默認爲 `editor.fontFamily` 的值。
  "terminal.integrated.fontFamily": "Consolas, 'Courier New', monospace",
  /* 集成終端:結束 */

  /* 導航路徑:開始 */
  // 啓用/禁用導航路徑
  "breadcrumbs.enabled": true,
  /* 導航路徑:結束 */

  /* Git:開始 */
  // 是否啓用 Git。
  "git.enabled": true,
  // 是否啓用自動刷新。(因爲Git不停的刷新致使卡頓時能夠禁用自動刷新,無卡頓略過這裏)
  "git.autorefresh": false,
  /* Git:結束 */

  /* ESLint:開始 */
  // Turns auto fix on save on or off.
  "eslint.autoFixOnSave": true,
  // The eslint options object to provide args normally passed to eslint when executed from a command line (see http://eslint.org/docs/developer-guide/nodejs-api#cliengine).
  "eslint.options": {
    "rules": {
      "quotes": ["error", "single"],
      "semi": ["error", "always"],
    }
  },
  // An array of language ids which should be validated by ESLint
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "html",
    {
      "language": "vue",
      "autoFix": true
    }
  ],
  /* ESLint:結束 */

  /* prettier:開始 */
  // Whether to add a semicolon at the end of every line
  "prettier.semi": true,
  // If true, will use single instead of double quotes
  "prettier.singleQuote": true,
  /* prettier:結束 */

  /* vetur:開始 */
  // Default formatter for <template> region
  //  - none: disable formatting
  //  - js-beautify-html: html formatter of js-beautify
  "vetur.format.defaultFormatter.html": "js-beautify-html",
  /* vetur:結束 */

}

安裝的擴展


關於本文

  • 做者:俠骨留香
  • 時間:2018年09月20日
  • 聯繫做者:xiaguliuxiang@foxmail.com
相關文章
相關標籤/搜索