Skip to main content

我的 Visual Studio Code 配置

· 3 min read
Alan

下面展示一下我的VSC配置:

Brief

.vscode/settings.json
{
"extensions.autoUpdate": false, // 禁用扩展自动更新
"extensions.autoCheckUpdates": false, // 禁用扩展自动更新
"update.mode": "manual", // VSC更新模式改为手动检测
"editor.lineNumbers": "relative", // 使用相对行号(方便Vim跳转)
// Markdown文件配置
"[markdown]": {
"editor.wordWrap": "on",
"editor.quickSuggestions": true // markdown文件智能提示默认开启(用于支持Snippets)
},
"window.closeWhenEmpty": true, // 如果打开文件为空,关闭VSC编辑器
"files.eol": "\n", // 文件换行符
"files.encoding": "utf8", // 文件编码
"editor.minimap.enabled": false, // 是否显示小地图
"explorer.confirmDelete": false, // 删除文件确认
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"emmet.triggerExpansionOnTab": true,
"todohighlight.maxFilesForSearch": 5120,
"explorer.autoReveal": "focusNoScroll"
}

2022-01-04

"settings.json
{
"extensions.autoUpdate": false, // 禁用扩展自动更新
"extensions.autoCheckUpdates": false, // 禁用扩展自动更新
"update.mode": "manual", // VSC更新模式改为手动检测
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"vim.useCtrlKeys": false,
"vim.easymotion": true,
"vim.leader": "\\",
"vim.surround": true,
"vim.hlsearch": true,
"editor.largeFileOptimizations": true,
"breadcrumbs.enabled": true,
"editor.renderControlCharacters": true,
"editor.lineNumbers": "relative",
"window.restoreWindows": "none",
"editor.renderWhitespace": "all",
"editor.renderIndentGuides": true,
"files.eol": "\n",
"files.encoding": "utf8",
"editor.minimap.enabled": false,
"explorer.confirmDelete": false,
"explorer.openEditors.visible": 0,
"editor.cursorBlinking": "phase",
"editor.smoothScrolling": true,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"entity.name.function",
"support.function"
],
"settings": {
"fontStyle": "italic bold"
}
}
]
},
"java.configuration.checkProjectSettingsExclusions": false,
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
// "window.zoomLevel": 2, // 放大缩小
"html.format.wrapLineLength": 0,
"editor.fontLigatures": true,
// "editor.fontFamily": "'Cascadia Code', '思源黑体 Light', Consolas, 'Courier New', monospace",
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"diffEditor.ignoreTrimWhitespace": true,
"gitlens.blame.ignoreWhitespace": true,
"java.semanticHighlighting.enabled": true,
"workbench.editor.scrollToSwitchTabs": true,
"yaml.schemas": {
"file:///toc.schema.json": "/toc\\.yml/i"
},
"gitlens.views.compare.files.layout": "list",
"explorer.confirmDragAndDrop": false,
"window.titleBarStyle": "custom",
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [
80
],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false
},
"settingsSync.keybindingsPerPlatform": false, // 隐藏title bar
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/.hg/store/**": true,
},
"workbench.activityBar.visible": true,
"[markdown]": {
"editor.wordWrap": "on",
"editor.quickSuggestions": true
},
"explorer.autoReveal": "focusNoScroll",
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"editor.tabSize": 2,
"rest-client.previewColumn": "current",
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"emmet.showExpandedAbbreviation": "inMarkupAndStylesheetFilesOnly",
"emmet.excludeLanguages": [
"markdown",
"tsx",
],
"window.closeWhenEmpty": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"node_modules": true
},
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/.hg/store/**": true
}
}
keybindings.json
[
{
"key": "ctrl+shift+i",
"command": "editor.action.formatDocument"
},
{
"key": "ctrl+shift+w",
"command": "workbench.action.closeOtherEditors"
},
{
"key": "ctrl+shift+r",
"command": "revealInExplorer"
},
{
"key": "alt+left",
"command": "workbench.action.navigateBack"
},
{
"key": "alt+right",
"command": "workbench.action.navigateForward"
},
{
"key": "f12",
"command": "editor.action.revealDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "ctrl+shift+d",
"command": "workbench.action.splitEditorDown"
},
{
"key": "ctrl+shift+l",
"command": "workbench.action.splitEditorLeft"
},
{
"key": "ctrl+shift+s",
"command": "saveAll"
},
{
"key": "ctl+shift+m",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "git status\u000D"
}
},
{
"key": "ctrl+e",
"command": "-workbench.action.quickOpen"
}
]