首页 » 工作 » 方法 » 正文

Visual Studio Code configuration (vs code 配置)

发布者:站点默认
2019/03/12 浏览数(1,166) 分类:方法 Visual Studio Code configuration (vs code 配置)已关闭评论

插件

// ctrl+p
ext install MS-CEINTL.vscode-language-pack-zh-hans
ext install ms-vscode.sublime-keybindings
ext install lixquid.calculator

快捷键

// keybindings.json
// Place your key bindings in this file to override the defaultsauto[]
[
  {
    "key": "alt+w", // 用标签包裹选中的文字
    "command": "editor.emmet.action.wrapWithAbbreviation",
    "when": "editorHasSelection && editorTextFocus"
  },
  {
    "key": "ctrl+shift+g", // 用标签分别包裹多行文本
    "command": "editor.emmet.action.wrapIndividualLinesWithAbbreviation",
    "when": "editorHasSelection && editorTextFocus"
  },
  {
    "key": "ctrl+shift+y", // 用值替换掉选中的表达式
    "command": "calculator.replace",
    "when": "editorHasSelection && editorTextFocus"
  }
]

配置

{
{
    // 窗口标题栏
    "window.title": "${dirty}${activeEditorMedium} - ${rootPath}",
    // 欢迎页
    "workbench.startupEditor": "newUntitledFile",
    // 此键可多光标
    "editor.multiCursorModifier": "ctrlCmd",
    // 缩进栏线
    "editor.rulers": [
      120,
      160
    ],
    // 行号栏一块高亮
    "editor.renderLineHighlight": "all",
    // 自动缩进
    "editor.detectIndentation": false,
    // TAB宽度
    "editor.tabSize": 2,
    // 用空格代替TAB
    "editor.insertSpaces": true,
    // 粘贴后自动格式化
    "editor.formatOnPaste": true,
    // 保存后自动格式化
    "editor.formatOnSave": false,
    // 显示空格
    "editor.renderWhitespace": "all",
    // 代码提示中优先显示 snippet
    // "editor.snippetSuggestions": "top",
    // 插入代码段
    "editor.tabCompletion": "on",
    // 控制键入时是否应自动显示建议(貌似代码片段功能需要这个)
    "editor.quickSuggestions": {
      "strings": true
    },
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "vetur.format.defaultFormatter.stylus": "stylus-supremacy",
    "vetur.format.defaultFormatterOptions": {
      "prettyhtml": {
        "printWidth": 120
      },
      "js-beautify-html": {
        "wrap_line_length": 120,
        // 属性强制折行对齐
        "wrap_attributes": "auto" // [auto|force|force-aligned|force-expand-multiline]
      },
      "prettier": {
        "semi": true,
        "printWidth": 120,
        "singleQuote": true,
      }
    },
    // 写 stylus 时插入冒号
    "stylusSupremacy.insertColons": true,
    // 写 stylus 时插入分号
    "stylusSupremacy.insertSemicolons": true,
    // 写 stylus 时插入大括号
    "stylusSupremacy.insertBraces": true,
    // 并列的选择器新加一行
    "stylusSupremacy.insertNewLineBetweenSelectors": true,
    // 样式块中间空行
    "stylusSupremacy.insertNewLineAroundBlocks": false,
    "explorer.confirmDragAndDrop": false,
    "explorer.confirmDelete": false,
    // 按下TAB展开emmet缩写
    "emmet.triggerExpansionOnTab": true,
    // 在默认不支持 Emmet 的语言中启用 Emmet 缩写功能
    "emmet.includeLanguages": {
      "javascript": "javascriptreact",
      "wxml": "html"
    },
    "javascript.updateImportsOnFileMove.enabled": "never",
    "editor.minimap.enabled": true,
    "window.zoomLevel": 0,
    "": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "files.associations": {
      "*.cjson": "jsonc",
      "*.wxss": "css",
      "*.wxs": "javascript"
    },
    "minapp-vscode.disableAutoConfig": true,
    "editor.wordWrapColumn": 120,
    "": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "liveServer.settings.donotShowInfoMsg": true,
    "lua.format.singleQuote": true,
    "[vue]": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "terminal.integrated.shell.osx": "/usr/local/bin/fish",
    "workbench.editor.limit.enabled": true,
    "workbench.editor.tabSizing": "shrink",
    "workbench.editor.limit.value": 12,
    "workbench.activityBar.visible": true,
    "editor.renderControlCharacters": true,
    "prettier.packageManager": "yarn",
    "prettier.printWidth": 120,
    "prettier.singleQuote": true
  }
}
点击返回顶部
  1. 留言
  2. 联系方式