MacOS VSCode Tips快捷键

Tips

  • 在 Android Studio 和 VS Code 中 输入 stl 然后点击回车,可以快速创建 StatelessWidget 组件,同理输入 stf 点击回车,可以快速创建 StatefulWidget 组件,这是编辑器 Live Templates 的功能.

General

  • ⇧⌘P, F1
    打开工具面板
  • ⌘P
    快速打开文件,会展示最近的文件
  • ⇧⌘N
    打开一个新的VSCode窗口
  • ⌘W
    关闭当前窗口
  • ⌘Q
    关闭程序
  • ⌘,
    打开用户设置
  • ⌘K ⌘S
    键盘组合键 打开键盘快捷方式

BasicEditing

  • ⌘X
    剪切选中的
  • ⌘C
    复制选中的
  • ⌥↓ / ⌥↑
    上下移动当前行
  • ⇧⌥↓ / ⇧⌥↑
    向上或向下复制当前行
  • ⇧⌘K
    删除当前行
  • ⌘Enter / ⇧⌘Enter
    ⌘Enter 向下换行, ⇧⌘Enter 向上换行
  • ⇧⌘\
    跳转到匹配的括号
  • ⌘] / ⌘[
    当前行左右移动去对齐
  • Home / End
    移动到当前行的头或尾
  • ⌘↑ / ⌘↓
    移动到当前窗口的头或尾
  • ⌃PgUp / ⌃PgDn
    当前窗口上下滚动
  • ⌘PgUp /⌘PgDn
    当前窗口上下翻页
  • ⌥⌘[ / ⌥⌘]
    展开或隐藏当前所属的括号
  • ⌘K ⌘[ / ⌘K ⌘]
    组合键 类似上一条的功能
  • ⌘K ⌘0 / ⌘K ⌘J
    组合键 隐藏或展开所有的区域
  • ⌘K ⌘C
    组合键 添加注释
  • ⌘K ⌘U
    组合键 解除注释
  • ⌘/
    添加或解除注释
  • ⇧⌥A
    添加 /* */的注释
  • ⌥Z
    自动换行 暂时没搞明白

multi-cursorAndSelection 多个光标的选择

  • ⌥ + click
    可选择多个光标行
  • ⌥⌘↑ ⌥⌘↓
    向上或向下选择光标行
  • ⌘U
    撤销上一次的光标操作
  • ⇧⌥I
    在选定的每行末尾插入光标
  • ⌘F2
    选择当前单词的所有匹配项
  • ⌃⇧⌘→ / ←
    选择当前行或取消
  • ⇧⌥ + drag mouse
    垂直方向上选中
  • ⇧⌥⌘↑ / ↓
    垂直方向上下选择
  • ⇧⌥⌘← / →
    垂直方向左右选择
  • ⇧⌥⌘PgUp
    垂直方向上下选择一页
  • ⇧⌥⌘PgDn

SearchAndReplace 搜索替换

  • ⌘F
    Find
  • ⌥⌘F
    Replace
  • ⌘G / ⇧⌘G
    Find next/previous
  • ⌥Enter
    Select all occurrences of Find match
  • ⌘D
    Add selection to next Find match
  • ⌘K ⌘D
    Move last selection to next Find match

richLanguagesEditing

  • ⌃Space
    Trigger suggestion
  • ⇧⌘Space
    Trigger parameter hints
  • ⇧⌥F
    Format document
  • ⌘K ⌘F
    Format selection
  • F12
    Go to Definition
  • ⌥F12
    Peek Definition
  • ⌘K F12
    Open Definition to the side
  • ⌘.
    Quick Fix
  • ⇧F12
    Show References
  • F2
    Rename Symbol
  • ⌘K ⌘X
    Trim trailing whitespace
  • ⌘K M
    Change file language

navigation

  • ⌘T
    Show all Symbols
  • ⌃G
    Go to Line...
  • ⌘P
    "Go to File...
  • ⇧⌘O
    Go to Symbol...
  • ⇧⌘M
    Show Problems panel
  • F8 / ⇧F8
    Go to next/previous error or warning
  • ⌃⇧Tab
    Navigate editor group history
  • ⌃- / ⌃⇧-
    Go back/forward
  • ⌃⇧M
    Change file language

editorManagement

  • ⌘W
    Close editor
    • ⌘K F
      Close folder
    • ⌘\
      Split editor
    • ⌘1 / ⌘2 / ⌘3
      Focus into 1st, 2nd, 3rd editor group
    • ⌘K ⌘← / ⌘K ⌘→
      Focus into previous/next editor group
    • ⌘K ⇧⌘← / ⌘K ⇧⌘→
      Move editor left/right
    • ⌘K ← / ⌘K →
      Move active editor group

fileManagement

  • ⌘N
    New File
  • ⌘O
    Open File...
  • ⌘S
    Save
  • ⇧⌘S
    Save As...
  • ⌥⌘S
    Save All
  • ⌘W
    Close

  • Close All
    ⌘K ⌘W

  • ⇧⌘T
    Reopen closed editor

  • ⌘K Enter
    Keep preview mode editor open
  • ⌃Tab / ⌃⇧Tab
    Open next / previous
  • ⌘K P
    Copy path of active file
  • ⌘K R
    Reveal active file in Finder
  • ⌘K O
    Show active file in new window/instance

display

  • ⌃⌘F
    Toggle full screen
  • ⌥⌘0
    Toggle editor layout (horizontal/vertical)
  • ⌘= / ⇧⌘-
    Zoom in/out
  • ⌘B
    Toggle Sidebar visibility
  • ⇧⌘E
    Show Explorer / Toggle focus
  • ⇧⌘F
    Show Search
  • ⌃⇧G
    Show Source Control

⇧⌘D
Show Debug

  • ⇧⌘X
    Show Extensions
  • ⇧⌘H
    Replace in files
  • ⇧⌘J
    Toggle Search details
  • ⇧⌘U
    Show Output panel
  • ⇧⌘V
    Open Markdown preview
  • ⌘K V
    Open Markdown preview to the side
  • ⌘K Z
    Zen Mode (Esc Esc to exit)

debug

  • F9
    Toggle breakpoint

  • F5
    Start/Continue

  • F11 / ⇧F11
    Step into/ out
  • F10
    Step over

  • ⇧F5
    Stop

-⌘K ⌘I
Show hover

integratedTerminal

  • ⌃`
    Show integrated terminal
  • ⌃⇧`
    Create new terminal
  • ⌘C
    Copy selection

  • ⌘↑ / ↓
    Scroll up/down

  • PgUp / PgDn
    Scroll page up/down

  • ⌘Home / End
    Scroll to top/bottom

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容