一、安装

1、下载链接:https://code.visualstudio.com/download
2、VSCode-darwin-stable.zip 解压缩,得到可执行文件。
3、把执行文件复制到 “应用程序”

参考:macOS安装VSCode

二、简介

VS Code:Visual Studio Code,定义为一个免费的、开源的跨平台编辑器。

三、资源管理器

setting.json

和用户设置一样。但只作用于当前文件夹

launch.json

用于代码调试

tasks.json

任务系统的配置文件。
group:分组。 有build(编译生成)、test(测试)、none 三种。
presentation:控制任务运行时,是否自动调出运行的界面。
options:
problemMatcher:

type: 一种当进程来运行,一种是在shell中当命令行还执行
label:任务的名字
command:表示shell运行哪个命令或者运行哪个程序

  1. {
  2. "version": "2.0.0",
  3. "tasks": [
  4. {
  5. "label": "test shell",
  6. "type": "shell",
  7. "command": "./scripts/test.sh",
  8. "windows": {
  9. "command": ".\\scripts\\test.cmd"
  10. },
  11. "group": "test",
  12. "presentation": {
  13. "reveal": "always",
  14. "panel": "new"
  15. },
  16. "options": {
  17. "cwd": "",
  18. "env": {},
  19. "shell": {
  20. "executable": "bash"
  21. }
  22. }
  23. }
  24. ]
  25. }

四、常用快捷键

ctrl+` 打开终端
cmd+shift+P 打开命令面板