Vscode快捷键(常用)

225 阅读2分钟

功能板块

按键功能
Ctrl + Shift + P,F1显示命令面板 Show Command Palette
Ctrl + P快速打开 Quick Open
Ctrl + Shift + N新窗口/实例 New window/instance
Ctrl + Shift + W关闭窗口/实例 Close window/instance
Ctrl + F查找 Find
Ctrl + H替换 Replace
F3 / Shift + F3查找下一个/上一个 Find next/previous
Ctrl+N新文件 New File
Ctrl+O打开文件... Open File...
Ctrl+S保存 Save
Ctrl+Shift+S另存为... Save As...
Ctrl+K S全部保存 Save All
Ctrl+F4关闭 Close
Ctrl+K Ctrl+W关闭所有 Close All
Ctrl+Shift+T重新打开关闭的编辑器 Reopen closed editor
Ctrl+Tab打开下一个 Open next
Ctrl+Shift+Tab打开上一个 Open previous
Ctrl+K P复制活动文件的路径 Copy path of active file

编辑功能

按键功能
Ctrl+X剪切行(空选定) Cut line (empty selection)
Ctrl+C复制行(空选定)Copy line (empty selection)
Alt+ ↑ / ↓向上/向下移动行 Move line up/down
Shift+Alt + ↓ / ↑向上/向下复制行 Copy line up/down
Ctrl+Shift+K删除行 Delete line
Ctrl+Enter在下面插入行 Insert line below
Ctrl+Shift+Enter在上面插入行 Insert line above
Ctrl+Shift+\跳到匹配的括号 Jump to matching bracket
Ctrl+] / [缩进/缩进行 Indent/outdent line
Home转到行首Go to beginning of line
End转到行尾 Go to end of line
Ctrl+Home转到文件开头 Go to beginning of file
Ctrl+End转到文件末尾 Go to end of file
Ctrl+Shift+[折叠(折叠)区域 Fold (collapse) region
Ctrl+Shift+]展开(未折叠)区域 Unfold (uncollapse) region
Ctrl+K Ctrl+[折叠(未折叠)所有子区域 Fold (collapse) all subregions
Ctrl+K Ctrl+]展开(未折叠)所有子区域 Unfold (uncollapse) all subregions
Ctrl+K Ctrl+0折叠(折叠)所有区域 Fold (collapse) all regions
Ctrl+K Ctrl+J展开(未折叠)所有区域 Unfold (uncollapse) all regions
Ctrl+K Ctrl+C添加行注释 Add line comment
Ctrl+K Ctrl+U删除行注释 Remove line comment
Ctrl+/切换行注释 Toggle line comment
Shift+Alt+A切换块注释 Toggle block comment
Alt+Z切换换行 Toggle word wrap