VsCode安装插件
设置Java和Maven环境
打开VsCode 的设置界面 Ctrl + , 搜索 java ,点击settings.json ,增加如下配置:
"editor.formatOnSave": true,
"editor.fontFamily": "'Sarasa Mono SC', Consolas,'Microsoft YaHei UI'",
"editor.mouseWheelZoom": true,
"editor.fontSize": 20,
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true,
"**/.vscode":true
},
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"java.configuration.maven.userSettings": "D:\\devtools\\apache-maven-3.6.1\\conf\\settings.xml",
"maven.executable.path": "D:\\devtools\\apache-maven-3.6.1\\bin\\mvn.cmd",
"maven.terminal.useJavaHome": true,
"maven.terminal.customEnv": [
{
"environmentVariable": "JAVA_HOME",
"value": "D:\\devtools\\Java\\jdk1.8.0_161"
}
],
"maven.executable.preferMavenWrapper": false,
"java.maven.downloadSources": true,
"java.maven.updateSnapshots": true,
"maven.excludedFolders": [
"**/.*",
"**/node_modules",
"**/target",
"**/bin"
],
创建Maven项目
可以输入ctrl + shift + p 输入maven 找到创建Maven 项目选项,或者如下点击创建Java项目按钮。
修改VsCode默认终端为git bash
VsCode的默认终端为Power Shell ,想修改为其他模拟终端可以按如下操作完成。
- 点击左下角的齿轮,展开点击设置
- 搜索
shell Window ,找到 Terminal ? Integrated ? Profiles: Windows设置,进行编辑 - 在最末尾大括号里添加如下配置,官方配置参考地址
"terminal.integrated.copyOnSelection": true,
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.profiles.windows": {
"git-bash": {
"path": "D:\\devtools\\Git\\bin\\bash.exe",
"args": []
}
},
"terminal.integrated.defaultProfile.windows": "git-bash"
|