VSCode 快捷键汇总

VSCode 快捷键汇总

前言

  • Coder 苦鼠标久已,整理汇总 VSCode 快捷键
  • 快捷键顺序没有特殊含义,想到什么就写什么,相对来说靠前的是作者比较常用的

快捷键汇总

  1. 复制: Ctrl + C
  2. 粘贴: Ctrl + V
  3. ⭐选中下个相同单词: Ctrl + D
  4. 选中所有相同单词: Ctrl + Shift + L
  5. 向下插入一行: Ctrl + Enter
  6. 向上插入一行: Ctrl + Shift + Enter
  7. ⭐是否自动换行: Alt + Z
  8. 切换对应的页签: Alt + 数字键(1,2,3…)
  9. 添加注释: Ctrl + /
  10. 添加注释: Ctrl + /
  11. 增加缩进: Ctrl + ]Tab
  12. 减少缩进: Ctrl + [Shift + Tab
  13. 打开终端: Ctrl + `Ctrl + J
  14. 聚焦多个光标并多行编辑: Alt + 鼠标
  15. 快速跳转到定义: Ctrl + 鼠标
  16. 快速跳转到定义【打开新分组】: Ctrl + Alt + 鼠标
  17. 选中多行后同时增加光标: Shift + Alt + I
  18. 放大: Ctrl + =
  19. 缩小: Ctrl + -
  20. 删除当前行: Ctrl + Shift + K
  21. 关闭当前页签: Ctrl + W
  22. 恢复已关闭的页签: Ctrl + Shift + T
  23. 移动当前行到上一行(下一行): Alt + 上/下方向键
  24. 复制当前行到上一行(下一行): Shift + Alt + 上/下方向键
  25. 跳转匹配括号: Ctrl + Shift + </kbd>
  26. 撤销光标操作: Ctrl + U
  27. 跳转上一步(下一步)操作的位置: Alt + 左/右方向键
  28. 快捷命令: Ctrl + Shift + P
  29. 文件名搜索: Ctrl + P
  30. 搜索: Ctrl + F
  31. 全文搜索: Ctrl + Shift + F
  32. 替换: Ctrl + H
  33. 保存: Ctrl + S
  34. 全选: Ctrl + A
  35. 剪切: Ctrl + X
  36. 撤销: Ctrl + Z
  37. 重做: Ctrl + Y
  38. ⭐显示侧边栏: Ctrl + B
  39. 聚焦侧边栏资源管理器: Ctrl + Shift + E
  40. 移动编辑窗口到指定分组: Ctrl + Alt + 左/右方向键
  41. 拆分编辑窗口到下一个分组: Ctrl + </kbd>
  42. 折叠当前代码块: Ctrl + Shift + [
  43. 展开当前代码块: Ctrl + Shift + ]
  44. 递归折叠当前代码块【两段式快捷键】: Ctrl + KCtrl + [
  45. 递归展开当前代码块【两段式快捷键】: Ctrl + KCtrl + ]
  46. 递归折叠所有代码块【两段式快捷键】: Ctrl + KCtrl + 0
  47. 递归展开所有代码块【两段式快捷键】: Ctrl + KCtrl + J

参考快捷键大全

自定义快捷键分享【风格偏Linux、Vim】

VSCode 快捷键都不够使用的,并且能使用自定义快捷键的默认为具备自行配置能力,如何配置不再赘述,直接上配置文件:

复制代码
// 将键绑定放在此文件中以覆盖默认值
[
  // 自定义方向键
  {
    "key": "alt+h",
    "command": "cursorLeft",
    "when": "textInputFocus"
  },
  {
    "key": "alt+j",
    "command": "cursorDown",
    "when": "textInputFocus"
  },
  {
    "key": "alt+k",
    "command": "cursorUp",
    "when": "textInputFocus"
  },
  {
    "key": "alt+l",
    "command": "cursorRight",
    "when": "textInputFocus"
  },
  {
    "key": "ctrl+alt+h",
    "command": "cursorWordEndLeft",
    "when": "textInputFocus && !accessibilityModeEnabled"
  },
  {
    "key": "ctrl+alt+l",
    "command": "cursorWordEndRight",
    "when": "textInputFocus && !accessibilityModeEnabled"
  },
  // 向左选中
  {
    "key": "ctrl+shift+alt+h",
    "command": "cursorWordLeftSelect",
    "when": "textInputFocus && !accessibilityModeEnabled"
  },
  // 向右选中
  {
    "key": "ctrl+shift+alt+l",
    "command": "cursorWordRightSelect",
    "when": "textInputFocus && !accessibilityModeEnabled"
  },
  // 向下选中
  {
    "key": "ctrl+shift+alt+j",
    "command": "cursorDownSelect",
    "when": "textInputFocus"
  },
  {
    "key": "ctrl+shift+alt+e",
    "command": "cursorBottomSelect",
    "when": "textInputFocus"
  },
  // 向上选中
  {
    "key": "ctrl+shift+alt+k",
    "command": "cursorUpSelect",
    "when": "textInputFocus"
  },
  {
    "key": "ctrl+shift+alt+a",
    "command": "cursorTopSelect",
    "when": "textInputFocus"
  },
  // 聚焦行首
  {
    "key": "alt+a",
    "command": "cursorHome",
    "when": "textInputFocus"
  },
  // 聚焦行尾
  {
    "key": "alt+e",
    "command": "cursorEnd",
    "when": "textInputFocus"
  },
  // 聚集页眉
  {
    "key": "ctrl+alt+a",
    "command": "cursorTop",
    "when": "textInputFocus"
  },
  // 聚集页尾部
  {
    "key": "ctrl+alt+e",
    "command": "cursorBottom",
    "when": "textInputFocus"
  },
  // 迁移编辑窗口到下一组
  {
    "key": "ctrl+alt+.",
    "command": "workbench.action.moveEditorToNextGroup",
    "when": "textInputFocus"
  },
  // 迁移编辑窗口到上一组
  {
    "key": "ctrl+alt+,",
    "command": "workbench.action.moveEditorToPreviousGroup",
    "when": "textInputFocus"
  },
  // 向上迁移编辑窗口
  {
    "key": "ctrl+k ctrl+alt+,",
    "command": "workbench.action.moveEditorToAboveGroup",
    "when": "textInputFocus"
  },
  // 向下迁移编辑窗口
  {
    "key": "ctrl+k ctrl+alt+.",
    "command": "workbench.action.moveEditorToBelowGroup",
    "when": "textInputFocus"
  },
  {
    "key": "ctrl+alt+.",
    "command": "workbench.action.moveEditorToNextGroup",
    "when": "textInputFocus"
  },
  // 聚焦下一组
  {
    "key": "alt+.",
    "command": "workbench.action.focusNextGroup",
    "when": "textInputFocus"
  },
  // 聚焦上一组
  {
    "key": "alt+,",
    "command": "workbench.action.focusPreviousGroup",
    "when": "textInputFocus"
  },
  // 代码块选择
  {
    "key": "shift+alt+q",
    "command": "editor.action.selectToBracket",
    "when": "textInputFocus"
  },
  // 往左删除
  {
    "key": "ctrl+h",
    "command": "deleteLeft",
    "when": "textInputFocus && !editorReadonly"
  },
  // 往右删除
  {
    "key": "alt+d",
    "command": "deleteRight",
    "when": "textInputFocus && !editorReadonly"
  },
  // 往左删除一个单词
  {
    "key": "alt+w",
    "command": "deleteWordLeft",
    "when": "textInputFocus && !editorReadonly"
  },
  // 删除整行
  {
    "key": "ctrl+shift+d",
    "command": "editor.action.deleteLines",
    "when": "textInputFocus && !editorReadonly"
  },
  // 删除到行首
  {
    "key": "ctrl+shift+u",
    "command": "deleteAllLeft",
    "when": "textInputFocus && !editorReadonly"
  },
  // 删除到行尾
  {
    "key": "ctrl+shift+k",
    "command": "deleteAllRight",
    "when": "textInputFocus && !editorReadonly"
  },
  // 替换当前行,依赖拓展插件 pasteReplaceLine
  {
    "key": "ctrl+shift+v",
    "command": "editor.action.pasteReplaceLine",
    "when": "textInputFocus && !editorReadonly"
  },
  // 选中下一个代码提示框
  {
    "key": "alt+.",
    "command": "selectNextSuggestion",
    "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion"
  },
  // 选中上一个代码提示框
  {
    "key": "alt+,",
    "command": "selectPrevSuggestion",
    "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion"
  },
]
相关推荐
___波子 Pro Max.3 小时前
Vim查看文件十六进制方法
编辑器·vim
Java斌6 小时前
70年使用权的IntelliJ IDEA Ultimate安装教程
java·ide·intellij-idea
weixin_466485116 小时前
PyCharm中运行.py脚本程序
ide·python·pycharm
程序猿小D6 小时前
第14节 Node.js 全局对象
linux·前端·npm·node.js·编辑器·vim
aningxiaoxixi7 小时前
Android Studio 之基础代码解析
android·ide·android studio
waterHBO7 小时前
一个小小的 flask app, 几个小工具,拼凑一下
javascript·vscode·python·flask·web app·agent mode·vibe coding
界面开发小八哥8 小时前
「Java EE开发指南」如何使用MyEclipse在Web项目中用Web Fragments?
java·前端·ide·java-ee·eclipse·myeclipse
咖啡续命又一天10 小时前
nano编辑器的详细使用教程
编辑器
伍六星10 小时前
更新Java的环境变量后VScode/cursor里面还是之前的环境变量
java·开发语言·vscode
西域曼波王16 小时前
哈尔滨工业大学计算机系统大作业程序人生-Hello’s P2P
linux·c语言·编辑器·vim