Skip to content

Visual Studio Code 常用快捷键

L edited this page Jun 5, 2019 · 4 revisions

设置快捷键

打开默认键盘快捷方式设置:File -> Preferences -> Keyboard Shortcuts
1
修改 keybindings.json

主命令框

打开命令面板:F1
寻找文件窗口:Ctrl+P

格式调整

代码格式化: Shift+Alt+F,或 Ctrl+Shift+P 后输入 format document
在当前行下边插入一行(无视光标位置):Ctrl+Enter

光标相关

移动到行首: Home
移动到行尾: End
移动到文件结尾: Ctrl+End
移动到文件开头: Ctrl+Home
移动到定义处: F12
定义处缩略图,只看一眼而不跳转过去:Alt+F12
选择从光标到行尾: Shift+End
选择从行首到光标处: Shift+Home
删除光标右侧的所有字: Ctrl+Delete
多行编辑(列编辑):Alt+Shift+鼠标左键,Ctrl+Alt+Down/Up

重构代码

查看 diff: 在 explorer 里选择文件右键 select for compare,然后需要对比的文件上右键选择 Compare with selected

查找替换

查找 Ctrl+F
查找替换 Ctrl+H

其他

自动保存:File -> AutoSave

Clone this wiki locally