VS Code 启程-介绍视频-代码编辑
本文章是up翻译的,侵权即删
在本篇教程中,我们涉及到编辑及运行小代码段,特性要点在下文中列出。阅读完本篇概要之后,如果想了解更多特性,请参阅
Linux 用户: 确保您已为Linux 发行版正确安装多媒体代码。举例:在 Ubuntu上,你可能需要安装
ubuntu-restricted-extras

选择其他视频:
打开文件夹
File > Open Folder (Ctrl+K Ctrl+O)
文件 > 打开文件夹 (Ctrl+K Ctrl+O)
使用文件浏览器查看文件夹中的文件及子文件夹
View > Explorer (Ctrl+Shift+E)
查看 > 资源管理器
安装 Node.js 运行时 (runtime) 来执行 JavaSScript 代码
在 https://nodejs.org/ 站点中找到你平台支持的 Node.js版本
检查 Node.js 安装状态
在终端或者命令提示符 (cmd) 中键入
node --version
新建文本文件
File > New File (Ctrl+N)
文件 > 新建文本文件 (Ctrl+N)
创建一个简单的 "Hello world" 控制台应用,名称为
app.js
智能感知根据你键入的代码提供相关建议
自动格式化源代码
Format Document command (Shift+Alt+F)
格式化文档命令 (Shift+Alt+F)
打开自动保存
File > Auto Save
文件 > 自动保存
显示集成终端
View > Terminal (Ctrl+`)
查看 > 终端 (Ctrl+`)
拆分终端
Split Terminal (Ctrl+Shift+5)
拆分终端 (Ctrl+Shift+5)
新建终端
Create New Terminal (Ctrl+Shift+`)
新建终端 (Ctrl+Shift+`)
运行应用
在集成终端中键入
node app.js
- 使用这些生产力小技巧成为一个专业的 VS Code 用户(https://code.visualstudio.com/docs/introvideos/productivity)
- 学习强大的 VS Code 编辑器(https://code.visualstudio.com/docs/editor/codebasics)
- 在源代码中快速移动(https://code.visualstudio.com/docs/editor/editingevolved)
- 使用 Emmet Snippets(https://code.visualstudio.com/docs/languages/html#_emmet-snippets)
- 在 VS Code 中新建任务来使用外部工具(https://code.visualstudio.com/docs/editor/tasks)
- 安装 JavaScript 装饰器(https://code.visualstudio.com/docs/languages/javascript#_linters)
- 查看源代码折叠细节(https://code.visualstudio.com/docs/editor/codebasics#_folding)