常用功能
常用快捷键
所有快捷键的查看方法: 如下图, 打开vscode, 点击 帮助 -> 快捷键参考
,将会弹出一个pdf网页,里面有所有快捷键方式. linux版本的快捷键pdf可直接点击这里访问
注意: 下面快捷键基于vscode的linux版本,对于其他版本不一定适用.
- 返回上一个光标位置:ctrl + alt + -
- 返回下一个光标位置:ctrl + sift + -
- 打开终端:ctrl + `,注意不是单引号,而是左上角数字键1左边的那个按键。
- 代码格式化:一键自动格式化代码,把轮乱的代码tab啥的对齐:
- Windows:Shift + Alt + F
- Mac: Shift + Option + F
- Ubuntu: Ctrl + Shift + I
好用的插件
适用于大众的插件:
Settings Sync
| 同步vscode的设置和已经下载的插件到github, 在新电脑上下载该插件可一键还原插件和设置Alignment
| 自动对齐代码 | This extension align chars in selection. It helps creating clean, formatted code.AutoFileName
| 字符串输入文件名时, 自动补全文件名Bracket Pair Colorizer
| 匹配各种类型的括号, 并且不同匹配对用不同颜色区分 | This extension allows matching brackets to be identified with colours. The user can define which characters to match, and which colours to use.indent-rainbow
| 提供了彩虹缩进功能,table或空格缩进后显示不同彩色 | This extension colorizes the indentation in front of your text alternating four different colors on each step. Some may find it helpful in writing code for Nim or Python.TODO Highlight
| 高亮TODO文本, 方便你快速找到自己TODO的地方. 当然也可以定制要高亮的文本
适用于C/C++的插件:
C/C++
| C++开发必装, 提供C++支持和语法高亮 | This preview release of the C/C++ extension adds language support for C/C++ to Visual Studio Code, including features such as IntelliSense and debugging.CMake
| C++开发必装, 提供cmake支持,如语法高亮和补全等GLSL Lint
| 提供了GLSL的lint功能 | This extension supports linting of GLS (OpenGL Shading Language). It uses the OpenGL and OpenGL ES shader validatorShader languages support for VS Code
| vscode进行shader编程必装vscode-cudacpp
| 提供了一些cuda的语法高亮和补全等, 要想支持.cu文件跳转, 还需要看这里:设置VScode支持.cu文件语法高亮及跳转的方法 | This extension supports most of the basic CUDA keywords and functions.
适用于web开发的插件:
Auto Rename Tag
| HTML标签通常成对出现,该插件可实现修改其中一个标签,另一个配对的标签也对应修改 | Automatically rename paired HTML/XML tag, same as Visual Studio IDE does.CSS Peek
| 提供CSS跳转到定义等功能 | This extension extends HTML and ejs code editing withGo To Definition
andGo To Symbol in Workspace
support for css/scss/less (classes and IDs) found in strings within the source code.Auto Close Tag
| 自动添加HTML/XML的结束标签 | Automatically add HTML/XML close tag, same as Visual Studio IDE or Sublime Text does.IntelliSense for CSS class names in HTML
| 提供CSS补全功能 | A Visual Studio Code extension that provides CSS class name completion for the HTML class attribute based on the definitions found in your workspace or external files referenced through the link element.Live Server
| 提供一个简单的网页服务器,让你的html文件能在vscode中运行Markdown Preview Enhanced
| 让vscode支持markdown文件
** LaTeX相关: **
LaTeX Workshop
| 使得vscode变成latex编辑器