VS Code 必知必会的 20 个快捷键!


在 MAC 上:
Ctrl + J
在 Ubuntu/Windows 上:通过 File>Preferences>Keyboard shortcuts打开快捷键的设置,并且绑定editor.action.joinLines你自己的快捷键。

在 Windows 上:
Shift + Alt + F
在 Mac 上:
Shift + Option + F
在 Ubuntu 上:
Ctrl + Shift + I

打开用户设置页面 (
Preferences>Settings>User TAB);
点击右上角的图标切换到代码编辑模式;

添加
"files.trimTrailingWhitespace": true到设置文件中;保存你的设置文件。


在 Windows/Ubuntu 上:
Ctrl + Shift + [
在 Mac 上:
Command+ Option + [
在 Windows/Ubuntu 上:
Ctrl + Shift + ]
在 Mac 上:
Command+ Option + ]

在 Windows 上:
Shift + Alt + Up/Down
在 Mac 上:
Shift + Option + Up/Down
在 Ubuntu 上:
Ctrl + Shift + Alt + Up/Down
File > Preferences > Keyboard Shortcuts
在 Windows 上:
Shift + Alt + \ or 2,3,4
在 Mac 上:
Command + \ or 2,3,4
在 Ubuntu 上:
Shift + Alt + \ or 2,3,4
123 也可以切换编辑器焦点。
"workbench.editor.closeEmptyGroups": falseView > Edit Layout 的菜单中,也有预设的布局:

在 Windows 上:
Ctrl+ d
在 Mac 上:
Command + d
在 Ubuntu 上:
Ctrl+ d

在 Windows 上:
Ctrl+ b
在 Mac 上:
Command + b
在 Ubuntu 上:
Ctrl+ b

Ctrl + G ,然后输入要跳转的行号,当然,你也可以使用Ctrl + P,然后输入:和要跳转的行号。在 Windows 上:
Ctrl + g
在 Mac 上:
Ctrl + gorCtrl + p
在 Ubuntu 上:
Ctrl + g

Ctrl + Shift + oCommand + Shift+ oCtrl + Shift + o@:

在 Windows 上:
Ctrl + t
在 Mac 上:
Command + t
在 Ubuntu 上:
Ctrl + t

在 Windows 上:
Ctrl + backspace
在 Mac 上:
Option + delete
在 Ubuntu 上:
Ctrl + backspace

在 Windows 上:
Ctrl + Shift + 右键头 / 左键头
在 Mac 上:
Option + Shift + 右键头 / 左键头
在 Ubuntu 上:
Ctrl + Shift + 右键头 / 左键头

在 Windows 上:
Ctrl + Shift + d
在 Mac 上:
Command + Shift +d
在 Ubuntu 上:
Ctrl + Shift + d

在 Windows 上:
Ctrl + x
在 Mac 上:
Command + x
在 Ubuntu 上:
Ctrl + x

在 Windows 上:
Ctrl + Alt + Up/Down
在 Mac 上:
Command + Alt + Up / Down
在 Ubuntu 上:
Ctrl + Alt + Up / Down

在 Windows 上:
F2
在 Mac 上:
F2
在 Ubuntu 上:
F2
F2,上下文中的引用都会被重命名。
在 Windows 上:
Shift + Alt
在 Mac 上:
Shift + Option
在 Ubuntu 上:
Shift + Alt
在 Windows 上:
Ctrl + p
在 Mac 上:
Command + p
在 Ubuntu 上:
Ctrl + p


Linux:https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf
Window:https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf
macOS:https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf
