VSCode生产工具详细配置

VSCode完美卸载

VSCode安装

软件包下载与安装

mingw-18.0-without-git.exe
go1.19.3.windows-arm64.zip
VSCodeUserSetup-x64-1.73.1.exe

常用设置

settings.json配置如下:

// settings.json

{
  // Code runner
  "code-runner.runInTerminal": true,
  "code-runner.saveFileBeforeRun": true,
  // C_Cpp
  "C_Cpp.default.cppStandard": "c++11",
  "C_Cpp.default.cStandard": "c99",
  "C_Cpp.default.includePath": [
    "D:\\Development\\Environment\\C_Cpp\\MinGW\\lib"
  ],
  "C_Cpp.default.intelliSenseMode": "gcc-x64",
  "C_Cpp.default.compilerPath": "D:\\Development\\Environment\\C_Cpp\\MinGW\\bin\\g++.exe",
  // https://mp.weixin.qq.com/s/hcQuzZK1_FcPTXS8ZBpqnw
  "html.autoClosingTags": true,
  "javascript.autoClosingTags": true,
  "typescript.autoClosingTags": true,
  "javascript.suggest.autoImports": true,
  "typescript.suggest.autoImports": true,
  "javascript.updateImportsOnFileMove.enabled": "always",
  "typescript.updateImportsOnFileMove.enabled": "always",
  "editor.linkedEditing": true,
  "editor.bracketPairColorization.enabled": true,
  "editor.codeActionsOnSave": {
    "source.organizeImports": true,
    "source.fixAll": true
  },
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.lineNumbers": "on",
  "editor.tabSize": 4,
  "editor.wordWrap": "bounded",
  "editor.wordWrapColumn": 120,
  "editor.cursorBlinking": "blink",
  "editor.cursorSmoothCaretAnimation": true,
  "editor.cursorWidth": 0,
  "editor.find.addExtraSpaceOnTop": true,
  "editor.find.autoFindInSelection": "multiline",
  "editor.find.seedSearchStringFromSelection": "always",
  "editor.fontFamily": "Consolas, 'Courier New', monospace",
  "editor.fontLigatures": true,
  "editor.fontWeight": "normal",
  "editor.formatOnPaste": true,
  "editor.formatOnSave": true,
  "editor.formatOnSaveMode": "file",
  "editor.formatOnType": true,
  "diffEditor.codeLens": true,
  "diffEditor.ignoreTrimWhitespace": false,
  "diffEditor.wordWrap": "inherit",
  "editor.minimap.enabled": true,
  "editor.minimap.maxColumn": 120,
  "editor.minimap.renderCharacters": true,
  "editor.minimap.scale": 1,
  "editor.minimap.showSlider": "mouseover",
  "editor.minimap.side": "right",
  "editor.minimap.size": "proportional",
  "editor.acceptSuggestionOnCommitCharacter": true,
  "editor.quickSuggestions": {
    "other": true,
    "comments": false,
    "strings": false
  },
  "editor.snippetSuggestions": "inline",
  "editor.suggest.filterGraceful": true,
  "editor.suggest.insertMode": "insert",
  "editor.suggest.localityBonus": true,
  "editor.suggest.shareSuggestSelections": true,
  "editor.suggest.showStatusBar": true,
  "editor.wordBasedSuggestionsMode": "matchingDocuments",
  "files.associations": {},
  "files.autoSave": "afterDelay",
  "files.autoSaveDelay": 1000,
  "files.encoding": "utf8",
  "files.eol": "auto",
  "files.insertFinalNewline": true,
  "files.simpleDialog.enable": false,
  "files.trimFinalNewlines": true,
  "files.trimTrailingWhitespace": true,
  "files.watcherExclude": {
    "**/.git/objects/**": true,
    "**/.git/subtree-cache/**": true,
    "**/node_modules/*/**": true,
    "**/.hg/store/**": true
  },
  "workbench.commandPalette.history": 50,
  "workbench.list.smoothScrolling": true,
  "workbench.startupEditor": "none",
  "workbench.welcomePage.walkthroughs.openOnInstall": true,
  "workbench.activityBar.iconClickBehavior": "toggle",
  "workbench.iconTheme": "vscode-icons",
  "workbench.tree.renderIndentGuides": "always",
  "workbench.view.alwaysShowHeaderActions": false,
  "breadcrumbs.enabled": true,
  "workbench.editor.centeredLayoutAutoResize": true,
  "workbench.editor.limit.enabled": true,
  "workbench.editor.limit.perEditorGroup": true,
  "workbench.editor.wrapTabs": false,
  "workbench.settings.editor": "ui",
  "workbench.settings.useSplitJSON": false,
  "zenMode.centerLayout": true,
  "zenMode.silentNotifications": true,
  "screencastMode.fontSize": 56,
  "screencastMode.verticalOffset": 20,
  "window.autoDetectColorScheme": false,
  "window.restoreWindows": "none",
  "window.newWindowDimensions": "default",
  "window.openWithoutArgumentsInNewWindow": "on",
  "explorer.autoReveal": true,
  "outline.showVariables": false,
  "search.actionsPosition": "right",
  "search.useReplacePreview": true,
  "debug.allowBreakpointsEverywhere": true,
  "debug.console.fontSize": 16,
  "launch": {
    "configurations": [],
    "compounds": []
  },
  "scm.alwaysShowActions": false,
  "scm.repositories.visible": 10,
  "go.addTags": {
    "tags": "json",
    "options": "json=omitempty",
    "promptForTags": false,
    "transform": "snakecase",
    "template": ""
  },
  "go.autocompleteUnimportedPackages": true,
  "go.buildFlags": ["-v"],
  "go.delveConfig": {
    "dlvLoadConfig": {
      "followPointers": true,
      "maxVariableRecurse": 1,
      "maxStringLen": 64,
      "maxArrayValues": 64,
      "maxStructFields": -1
    },
    "apiVersion": 2,
    "showGlobalVariables": false,
    "debugAdapter": "legacy",
    "substitutePath": []
  },
  "go.formatTool": "goimports",
  "go.docsTool": "godoc",
  "go.lintTool": "golint",
  "go.useCodeSnippetsOnFunctionSuggest": true,
  "go.useLanguageServer": true,
  "[go]": {
    "editor.defaultFormatter": "golang.go",
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
      "source.organizeImports": true
    },
    "editor.suggest.snippetsPreventQuickSuggestions": false
  },
  "[go.mod]": {
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
      "source.organizeImports": true
    }
  },
  "gopls": {
    "usePlaceholders": true,
    "staticcheck": false
  },
  "markdown-preview-enhanced.enableExtendedTableSyntax": true,
  "markdown-preview-enhanced.enableScriptExecution": true,
  "markdown-preview-enhanced.breakOnSingleNewLine": false,
  "wordcount_cjk.activateLanguages": ["markdown", "plaintext", "latex"],
  "wordcount_cjk.statusBarTextTemplate": "中文:${cjk} 字 + 英文:${en_words} 词",
  "wordcount_cjk.statusBarTooltipTemplate": "中文字数:${cjk} \\n 非 ASCII 字符数:\\t${total - ascii} \\n 英文单词数:${en_words} \\n 非空白字符数:${total - whitespace} \\n 总字符数:${total}",
  "rust-analyzer.enableCargoWatchOnStartup": "true", // 打开项目时自动开启 cargo watch
  "rust-analyzer.highlightingOn": true,
  "rust-analyzer.lru.capacity": 1000,
  "vsicons.dontShowNewVersionMessage": true,
  "code-runner.executorMap": {
    "javascript": "node",
    "java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
    "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
    "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
    "objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
    "php": "php",
    "python": "python3 -u",
    "perl": "perl",
    "perl6": "perl6",
    "ruby": "ruby",
    "go": "go run",
    "lua": "lua",
    "groovy": "groovy",
    "powershell": "powershell -ExecutionPolicy ByPass -File",
    "bat": "cmd /c",
    "shellscript": "bash",
    "fsharp": "fsi",
    "csharp": "scriptcs",
    "vbscript": "cscript //Nologo",
    "typescript": "ts-node",
    "coffeescript": "coffee",
    "scala": "scala",
    "swift": "swift",
    "julia": "julia",
    "crystal": "crystal",
    "ocaml": "ocaml",
    "r": "Rscript",
    "applescript": "osascript",
    "clojure": "lein exec",
    "haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",
    "rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
    "racket": "racket",
    "scheme": "csi -script",
    "ahk": "autohotkey",
    "autoit": "autoit3",
    "dart": "dart",
    "pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
    "d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",
    "haskell": "runhaskell",
    "nim": "nim compile --verbosity:0 --hints:off --run",
    "lisp": "sbcl --script",
    "kit": "kitc --run",
    "v": "v run",
    "sass": "sass --style expanded",
    "scss": "scss --style expanded",
    "less": "cd $dir && lessc $fileName $fileNameWithoutExt.css",
    "FortranFreeForm": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
    "fortran-modern": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
    "fortran_fixed-form": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
    "fortran": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
    "sml": "cd $dir && sml $fileName"
  }
}

插件安装

在这里插入图片描述在这里插入图片描述在这里插入图片描述

VSCode打造多语言IDE

Shell

添加链接描述

Python

C/C++

launch.json配置如下:

//launch.json

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "g++.exe - 生成和调试活动文件",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "D:\\Development\\Environment\\C_Cpp\\MinGW\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "为 gdb 启用整齐打印",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "将反汇编风格设置为 Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: g++.exe 生成活动文件"
        }
    ]
}

task.json配置如下:

// task.json

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: g++.exe 生成活动文件",
            "command": "D:\\Development\\Environment\\C_Cpp\\MinGW\\bin\\g++.exe",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "调试器生成的任务。"
        }
    ],
    "version": "2.0.0"
}

Golang

go install github.com/766b/go-outliner@latest
go install github.com/acroca/go-symbols@latest
go install github.com/davidrjenni/reftools/cmd/fillstruct@latest
go install github.com/fatih/gomodifytags@latest
go install github.com/go-delve/delve/cmd/dlv@latest
go install github.com/josharian/impl@latest
go install github.com/ramya-rao-a/go-outline@latest
go install github.com/rogpeppe/godef@latest
go install github.com/sqs/goreturns@latest
go install github.com/stamblerre/gocode@latest
go install golang.org/x/lint/golint@latest
go install golang.org/x/tools/gopls@latest
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/tools/cmd/guru@latest
go install golang.org/x/tools/cmd/gorename@latest
go install github.com/cweill/gotests/gotests@v1.5.0
go install github.com/haya14busa/goplay/cmd/goplay@v0.9.0
go install github.com/dominikh/go-tools/cmd/staticcheck@v0.3.2
go install honnef.co/go/tools/cmd/staticcheck@2022.1
go install github.com/uudashr/gopkgs/cmd/gopkgs@v1.3.2

Rust

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值