0%

VSCode 使用笔记

在新的 window 中打开文件夹

设置搜索 openFoldersInNewWindow 改成 on

VScode teminal 显示中文乱码怎么解决

在终端中输入 “chcp 65001” 命令,将终端字符集修改为 UTF-8 编码。
这只能临时解决,永久解决此问题:
在 settings.json 中添加:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"overrideName": true,
"args": ["-NoExit", "/c", "chcp 65001"],
"icon": "terminal-powershell",
"env": {
"TEST_VAR": "value"
}
},
"Command Prompt": {
"path": "C:\\Windows\\System32\\cmd.exe",
"args": ["-NoExit", "/K", "chcp 65001"]
}
},
"terminal.integrated.defaultProfile.windows": "PowerShell"

在 Command Prompt 中,使用 “/K” 选项而不是 “-NoExit” 选项来保持窗口打开。在 “args” 中,”chcp 65001” 用于设置 Command Prompt 的代码页为 UTF-8 编码。

VScode 编译 C++ 多文件

tasks.json 中 {file} 改为 {fileDirname}\*.cpp

VScode 中编译 Java

  1. 下载插件 Java Extension Pack
  2. 配置 Java:home, 文件 -> 首选项 -> 设置,然后输入 javahome 进行搜索 点击在 setting.json 中编辑
  3. 调试运行