Interface overview
Key | Function | Command |
---|---|---|
Ctrl+Shift+E | File explorer | View:Show Explorer |
Ctrl+Shift+F | Search across files | Search:Find in files |
Ctrl+Shift+G | Source code management | |
Ctrl+Shift+D | Launch and debug | |
Ctrl+Shift+X | Manage extensions | View:Show extensions |
Ctrl+Shift+P | Find and run all commands | Show All commands |
Ctrl+Shift+M | View errors and warnings | View:Toggle Problems(Errors, Warnings, Infos) |
Ctrl+` | Toggle integrated terminal | View: Toogle Integrated Terminal |
Interactive Editor Playground
- Multi-cursor Editing - block selection, select all occurrences, add additional cursors and more
- IntelliSense - get code assistance and parameter suggestions for your code and external modules.
- Line Actions - quickly move lines around to re-order your code.
- Rename Refactoring - quickly rename symbols across your code base.
- Refactoring via Extraction - quickly extract common code into a separate function or constant.
- Formatting - keep your code looking great with inbuilt document & selection formatting.
- Code Folding - focus on the most relevant parts of your code by folding other areas.
- Errors and Warnings - see errors and warning as you type.
- Snippets - spend less time typing with snippets.
- Emmet - integrated Emmet support takes HTML and CSS editing to the next level.
- JavaScript Type Checking - perform type checking on your JavaScript file using TypeScript with zero configuration.
Multi-Cursor Editing
Box Selection
- Shift+Alt 用鼠标左键或者鼠标滑轮拖动
- Shift+Alt+UpArrow/DownArrow 进行选择,也可以通过 Alt+Click 在任何地方增加光标
- 在匹配的相同字符串上创建光标: 选中字符串,然后 Ctrl+Shift+L
IntelliSense
Visual Studio Code comes with the powerful IntelliSense for JavaScript and TypeScript pre-installed.
快捷键: Ctrl+Space
Line Actions
- Copy a line and insert it above or below the current position with Ctrl+Shift+Alt+DownArrow or Ctrl+Shift+Alt+UpArrow respectively.
- Move an entire line or selection of lines up or down with Alt+UpArrow and Alt+DownArrow respectively.
- Delete the entire line with Ctrl+Shift+K.
Rename Refactoring(更名重构)
- F2
Refactoring via Extraction
将某块代码提取为一个单独的函数:
- Ctrl+.
Formatting
- 整个文件: Ctrl+Shift+I
- 选中代码: Ctrl+K Ctrl+F
Code Folding
- 部分代码折叠: Ctrl+Shift+[ / ]
- 选中全部折叠: Ctrl+K Ctrl+0 ; Ctrl+K Ctrl+J
Errors and Warnings
- F8
Snippets
通过使用 Snippets 可以加快编辑速度.
- 例如输入 try 然后在建议列表中选择 trycatch 然后按 Tab 键来创建 try->catch block.
- 多个参数的输入可以使用 Tab 键进行跳转.
Emmet
Emmet 将 Snippets 的思想带到了一个全新的 level: 输入 CSS-like 表达式可以被 动态解析, 解析结果依赖于你的输入缩写.
JavaScript Type Checking
Sometimes type checking your JavaScript code can help you spot mistakes you might have not caught otherwise. You can run the TypeScript type checker against your existing JavaScript code by simply adding a // @ts-check comment to the top of your file.
网友评论