使用Visual Studio Code,快捷键会这几条就够了

1,016 阅读3分钟

请注意:本文中的快捷键主要应用于Linux桌面系统,其他系统仅作参考。

全局快捷键

  1. Ctrl+Shift+P,F1
    Show Command Palette : 显示调色板(控制板)
  2. Ctrl+P
    Go to file, quick open : 定位到文件或快速打开
  3. Ctrl+Shift+N
    Open a new window/instance : 打开一个新的窗口/实例
  4. Ctrl+W
    Close window , changed to close editor: 关闭窗口,已经被我自定义为关闭编辑器
  5. Ctrl+,
    User settings : 打开用户配置页面
  6. Ctrl+K Ctrl+S
    Keyboard Shortcuts : 键盘快捷键配置
  7. Ctrl+Shift+w
    Close current window : 关闭窗口

基本编辑

  1. Alt+Up/Down
    Move line down/up : 行进行上下
  2. Ctrl+Shift+K
    Delete line : 删掉本行
  3. Ctrl+Up/Down
    Scroll line up/down : 按行上行,下行
  4. Ctrl+Shift+[/]
    Fold/Unfold region : 打开关闭区域
  5. Ctrl+K Ctrl+[/]
    Fold/Unfold all subregions : 打开关闭所有子区域
  6. Ctrl+Shift+Up/Down
    Multiline choose : 多行多光标选取
  7. Ctrl+Shift+L
    Select all occurrences of current selection : 选取本选取多次出现的地方
  8. Ctrl+F2
    Select all occurrences of current word : 选取本词多次出现的地方

显示

  1. F11
    Full Screen : 全屏
  2. Ctrl+B (Ctrl+Shift+B customized)
    Toggle Sidebar visibility : 侧边栏开关
  3. Ctrl+Shift+E
    Show Explorer / Toggle focus : 探索页展示/焦点切换
  4. Ctrl+Shift+F
    Show search : 展示搜索页面
  5. Ctrl+Shift+G
    Show source control : 展示资源控制页面
  6. Ctrl+Shift+D
    Show debug : 展示Debug页面
  7. Ctrl+Shift+X
    Show Extensions : 展示插件安装页面
  8. Ctrl+Shift+H
    Replace in file : 替换页面,与搜索页面同
  9. Ctrl+Shift+C
    Open new command prompt/terminal : 打开新的终端
  10. Ctrl+K Ctrl+H
    Open new output panel : 打开新的输出页面
  11. Ctrl+K V (Ctrl+K Ctrl+V customized)
    Open markdown preview on right panel : 在右边打开新的Markdown预览页面
  12. Ctrl+K Z
    Toggle Zen mode : 禅模式开关

导航

  1. Ctrl+G
    Go to lines : 跳到行
  2. Ctrl+Shift+M
    Show problems panel : 展示问题看板

编辑器操作

  1. Ctrl+W
    Close editor : 关闭编辑器
  2. Ctrl+K F
    Close folder : 关闭文件夹
  3. Ctrl+\
    Split editor : 分割编辑器
  4. Ctrl+1 / 2 / 3
    Focus into 1th,2nd,3rd editor group : 切换编辑器组
  5. Ctrl+K Ctrl+left/right
    Focus into previous/next group : 切换到前后编辑器组
  6. Ctrl+Shift+PageUp/PageDown
    Move current editor left/right : 移动当前编辑器向左向右
  7. Ctrl+K left/right
    Move editor group left/right : 移动当前编辑器组
  8. Ctrl+K Ctrl+W
    Close all editors : 关闭所有编辑器

文件操作

  1. Ctrl+N
    New file : 新建文件
  2. Ctrl+O
    Open file : 打开文件
  3. Ctrl+K Ctrl+O
    Open directory : 打开目录
  4. Ctrl+S
    Save file : 保存文件
  5. Ctrl+Shift+S
    Save As... : 另存为
  6. Ctrl+K P
    Copy path of active file : 拷贝当前文件的目录
  7. Ctrl+Shift+T
    Reopen closed editor : 打开已关闭的编辑器
  8. Ctrl+Tab
    Open next editor : 切换到下一个编辑器
  9. Ctrl+Shift+Tab
    Open previous editor : 切换到上一个编辑器
  10. Ctrl+K R
    Reveal active file in explorer : 在当前文件所在的文件夹
  11. Ctrl+K O
    Show active file in new window/instance : 将当前文件在新的窗口中打开

内嵌的终端

  1. Ctrl+`
    Show intergrated terminal : 开关内置终端
  2. Ctrl+Shift+`
    Create new terminal : 打开一个新的终端
  3. Ctrl+Shift+V
    Paste things in this terminal : 将数据粘贴到当前终端
  4. Ctrl+Shift+Up/Down
    Scroll up/down in this terminal : 在当前终端上/下滚动一行
  5. Ctrl+Shift+PageUp/PageDown
    Scroll page up/down in this terminal : 在当前终端上/下滚动一页

系统快捷键(乱入)

  1. Shift+Alt(Hold)
    Ubuntu System shortcut : 系统快捷键

参考

Visual studio Code keyboard shortcuts for linux