用户工具

站点工具


02-工程实践:开发工具:vscode:首页

vscode

终端改为msys2的mingw64

注意路径不能有空格和 .,一开始安装路径为 D:\MinGW\msys\2.0\usr\bin ,会报错 exit code 2,表示找不到文件1)

配置2)

snippet.json
 "terminal.integrated.shell.windows": "D:\\msys64\\msys2_shell.cmd",
 "terminal.integrated.shellArgs.windows": ["-defterm", "-mingw64", "-no-start", "-here"],

上面配置换一个msys2版本可能就不能用了,可以试试下面的配置

snippet.json
{
    "terminal.integrated.shell.windows": "D:\\msys64\\usr\\bin\\bash.exe",
    "terminal.integrated.shellArgs.windows": ["-l"],
    "terminal.integrated.env.windows": {
        "CHERE_INVOKING": "1",
        "MSYSTEM": "MINGW64",
    }
}

使用msys2的git

直接使用 会提示 没有活动的源代码控制提供程序,参见3)

snippet.bat
@echo off
setlocal
 
rem If you don't add path for msys2 into %PATH%, enable following line.
set PATH=d:\msys64\usr\bin;%PATH%
 
if "%1" equ "rev-parse" goto rev_parse
git %*
goto :eof
:rev_parse
for /f %%1 in ('git %*') do cygpath -w %%1

附:VS Code 完整设置

snippet.json
{
    "terminal.integrated.shell.windows": "D:\\msys64\\usr\\bin\\bash.exe",
    "terminal.integrated.shellArgs.windows": ["-l"],
    "terminal.integrated.env.windows": {
        "CHERE_INVOKING": "1",
        "MSYSTEM": "MINGW64",
	},
	"git.postCommitCommand": "push",
    "git.path": "D:\\msys64\\git-vscode.bat",
    "editor.insertSpaces": false,
	"editor.detectIndentation": false,
	"editor.wordWrap": "on",
	"editor.snippetSuggestions": "top",
	"editor.tabCompletion": "on",
	"pangu.auto_format_on_save": true,
	"go.formatTool": "gofmt",
	"go.useLanguageServer": true,
	"terminal.integrated.automationShell.windows": "",
}
02-工程实践/开发工具/vscode/首页.txt · 最后更改: 2020/07/17 10:49 由 annhe