VSCode设置bash处理
全局VS Code设置文件路径:C:\Users\wyp\AppData\Roaming\Code\User\settings.json
vscode—修改默认的shell
1、修改默认的shell的方法步骤:
1. Ctrl + Shift + P : 调出命令输入框
2. 输入 Terminal: Select Default Shell
3. 输入要使用的 shell 或者选择也可,例如:
在C:\Users\wyp\AppData\Roaming\Code\User\settings.json文件里,设置 -l 参数,需要配置环境变量Path的值为bash所在的路径,-l 表示登录,可以获取环境变量信息。
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": [ "-l" ],
配置好终端使用shell之后,就可以测试一下linux命令了:
2、打开vscode 的设置git路径:
输入:git.p
这里面有一个git.path,设置 git.exe 文件所在的路径,
"git.defaultCloneDirectory": "", "git.path": "C:\\Program Files\\Git\\bin\\git.exe"
最终设置之后的截图:
3、每个项目具体的VS Code设置:例如:设置IDE字体大小
.vscode\settings.json 文件内容
{ "editor.fontFamily": "JetBrains Mono", "editor.fontSize": 14, "editor.fontLigatures": "true", "editor.fontWeight": "normal", "debug.console.fontFamily": "Fira Code,JetBrains Mono", "scm.inputFontFamily": "Fira Code,JetBrains Mono", "terminal.integrated.fontFamily": "Fira Code,JetBrains Mono", "rest-client.fontFamily": "Fira Code,JetBrains Mono", "rest-client.fontSize": 15, "window.zoomLevel": 1.0, "window.autoDetectColorScheme": true, "workbench.colorTheme": "Night Owl (No Italics)", "workbench.tree.indent": 16 }
4、安装command-variable插件
设置执行.vscode\launch.json,.vscode\tasks.json可以用到自定义宏(例如:解决方案文件夹路径),等用于VS2019里面的宏。
task.json 文件内容

1 { 2 // See https://go.microsoft.com/fwlink/?LinkId=733558 3 // for the documentation about the tasks.json format 4 "version": "2.0.0", 5 "tasks": [ 6 { 7 "label": "copy-template-wwwroot", 8 "command": "${command:extension.commandvariable.workspace.workspaceFolderPosix}/build/template-copy", 9 "args": [ 10 "${command:extension.commandvariable.workspace.workspaceFolderPosix}" 11 ], 12 "type": "shell", 13 "group": "build", 14 "presentation": { 15 "reveal": "silent" 16 }, 17 "problemMatcher": "$msCompile" 18 }, 19 { 20 "label": "template-1000", 21 "command": "${command:extension.commandvariable.workspace.workspaceFolderPosix}/build/template-build", 22 "args": [ 23 "${command:extension.commandvariable.workspace.workspaceFolderPosix}", 24 "1000" 25 ], 26 "type": "shell", 27 "group": "build", 28 "presentation": { 29 "reveal": "silent" 30 }, 31 "problemMatcher": "$msCompile" 32 }, 33 { 34 "label": "template-1001", 35 "command": "${command:extension.commandvariable.workspace.workspaceFolderPosix}/build/template-build", 36 "args": [ 37 "${command:extension.commandvariable.workspace.workspaceFolderPosix}", 38 "1001" 39 ], 40 "type": "shell", 41 "group": "build", 42 "presentation": { 43 "reveal": "silent" 44 }, 45 "problemMatcher": "$msCompile" 46 }, 47 { 48 "label": "template-1002", 49 "command": "${command:extension.commandvariable.workspace.workspaceFolderPosix}/build/template-build", 50 "args": [ 51 "${command:extension.commandvariable.workspace.workspaceFolderPosix}", 52 "1002" 53 ], 54 "type": "shell", 55 "group": "build", 56 "presentation": { 57 "reveal": "silent" 58 }, 59 "problemMatcher": "$msCompile" 60 }, 61 { 62 "label": "template-1003", 63 "command": "${command:extension.commandvariable.workspace.workspaceFolderPosix}/build/template-build", 64 "args": [ 65 "${command:extension.commandvariable.workspace.workspaceFolderPosix}", 66 "1003" 67 ], 68 "type": "shell", 69 "group": "build", 70 "presentation": { 71 "reveal": "silent" 72 }, 73 "problemMatcher": "$msCompile" 74 }, 75 76 { 77 "label": "build-template", 78 "command": "${command:extension.commandvariable.workspace.workspaceFolderPosix}/build/template-build", 79 "args": [ 80 "${command:extension.commandvariable.workspace.workspaceFolderPosix}" 81 ], 82 "type": "shell", 83 "group": "build", 84 "presentation": { 85 "reveal": "silent" 86 }, 87 "problemMatcher": "$msCompile" 88 }, 89 { 90 "label": "build-www", 91 "command": "dotnet", 92 "type": "shell", 93 "args": [ 94 "build", 95 "-p:SkipPostBuild=True", 96 "${command:extension.commandvariable.workspace.workspaceFolderPosix}/meshop/MeShop.View.WWW/MeShop.View.WWW.csproj" 97 ], 98 "group": "build", 99 "presentation": { 100 "reveal": "silent" 101 }, 102 "dependsOn":["build-template"], 103 "problemMatcher": "$msCompile" 104 } 105 ] 106 }
launch.json 文件内容

1 { 2 // 使用 IntelliSense 了解相关属性。 3 // 悬停以查看现有属性的描述。 4 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 "version": "0.2.0", 6 "configurations": [ 7 { 8 "name": "meshop-www", 9 "type": "coreclr", 10 "request": "launch", 11 "preLaunchTask": "build-www", 12 "program": "${workspaceFolder}/meshop/MeShop.View.WWW/bin/Debug/MeShop.View.WWW.dll", 13 "args": [ 14 15 ], 16 "cwd": "${workspaceFolder}/meshop/MeShop.View.WWW", 17 "stopAtEntry": false, 18 "serverReadyAction": { 19 "action": "openExternally", 20 "pattern": "\\bNow listening on:\\s+(https?://\\S+)" 21 }, 22 "requireExactSource": false, 23 "env": { 24 "HOST_ADMIN": "deverr", 25 "ASPNETCORE_ENVIRONMENT": "Development", 26 "MESHOP_CDN": "cdn.meshop.net" 27 }, 28 "sourceFileMap": { 29 "/Views": "${workspaceFolder}/Views" 30 } 31 } 32 ] 33 }
分类:
ASP.NET Core
, VS
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现