返回首页

VS Code 快捷键与配置

编辑效率

操作Windows / LinuxmacOS
命令面板Ctrl+Shift+PCmd+Shift+P
快速打开文件Ctrl+PCmd+P
复制当前行Shift+Alt+DownShift+Opt+Down
移动当前行Alt+Up/DownOpt+Up/Down
多光标Alt+ClickOpt+Click
选中下一个相同词Ctrl+DCmd+D
选中所有相同词Ctrl+Shift+LCmd+Shift+L
注释当前行Ctrl+/Cmd+/

导航与查找

终端与窗口

一份顺手的配置

把下面这段放进 settings.json,按需取舍:

{
  "editor.fontSize": 14,
  "editor.fontFamily": "JetBrains Mono, Consolas, monospace",
  "editor.fontLigatures": true,
  "editor.cursorBlinking": "smooth",
  "editor.smoothScrolling": true,
  "editor.bracketPairColorization.enabled": true,
  "editor.guides.bracketPairs": "active",
  "files.autoSave": "afterDelay",
  "files.trimTrailingWhitespace": true,
  "editor.formatOnSave": true,
  "editor.minimap.enabled": false,
  "workbench.layoutControl.enabled": false
}

推荐插件思路

不必堆插件,按需要装:

工具的价值在于减少摩擦,而不是增加配置。能记住的快捷键,永远比菜单快。