Skip to content

使用 Code 代码编辑器时的键盘快捷键#

Code 代码节点编辑环境支持一系列键盘快捷键,以加快并增强您的使用体验。选择适当的选项卡以查看适用于您操作系统的相关快捷键。

Cursor Movement 光标移动#

Action 操作 Shortcut 快捷键
Move cursor left 向左移动光标 Left
Move cursor right 向右移动光标 Right
Move cursor up 向上移动光标 Up
Move cursor down 向下移动光标 Down
Move cursor by word left 按单词向左移动光标 Ctrl+Left
Move cursor by word right 按单词向右移动光标 Ctrl+Right
Move to line start 移动到行首 Home or Ctrl+Left
Move to line end 移动到行尾 End or Ctrl+Right
Move to document start 移动到文档开头 Ctrl+Home
Move to document end 移动到文档结尾 Ctrl+End
Move page up 向上翻页 Page Up
Move page down 向下翻页 Page Down
Action 操作 Shortcut 快捷键
Move cursor left 向左移动光标 Left or Ctrl+B
Move cursor right 向右移动光标 Right or Ctrl+F
Move cursor up 向上移动光标 Up or Ctrl+P
Move cursor down 向下移动光标 Down or Ctrl+N
Move cursor by word left 按单词向左移动光标 Option+Left
Move cursor by word right 按单词向右移动光标 Option+Right
Move to line start 移动到行首 Cmd+Left or Ctrl+A
Move to line end 移动到行尾 Cmd+Right or Ctrl+E
Move to document start 移动到文档开头 Cmd+Up
Move to document end 移动到文档结尾 Cmd+Down
Move page up 向上翻页 Page Up or Option+V
Move page down 向下翻页 Page Down or Ctrl+V
Action 操作 Shortcut 快捷键
Move cursor left 向左移动光标 Left
Move cursor right 向右移动光标 Right
Move cursor up 向上移动光标 Up
Move cursor down 向下移动光标 Down
Move cursor by word left 按单词向左移动光标 Ctrl+Left
Move cursor by word right 按单词向右移动光标 Ctrl+Right
Move to line start 移动到行首 Home or Ctrl+Left
Move to line end 移动到行尾 End or Ctrl+Right
Move to document start 移动到文档开头 Ctrl+Home
Move to document end 移动到文档结尾 Ctrl+End
Move page up 向上翻页 Page Up
Move page down 向下翻页 Page Down

Selection 选择#

Action 操作 Shortcut 快捷键
Selection with any movement key 配合任意移动键选择 Shift + [Movement Key]
Select all 全选 Ctrl+A
Select line 选择行 Ctrl+L
Select next occurrence 选择下一个匹配项 Ctrl+D
Select all occurrences 选择所有匹配项 Shift+Ctrl+L
Go to matching bracket 跳转到匹配括号 Shift+Ctrl+\
Action 操作 Shortcut 快捷键
Selection with any movement key 配合任意移动键选择 Shift + [Movement Key]
Select all 全选 Cmd+A
Select line 选择行 Cmd+L
Select next occurrence 选择下一个匹配项 Cmd+D
Go to matching bracket 跳转到匹配括号 Shift+Cmd+\
Action 操作 Shortcut 快捷键
Selection with any movement key 配合任意移动键选择 Shift + [Movement Key]
Select all 全选 Ctrl+A
Select line 选择行 Ctrl+L
Select next occurrence 选择下一个匹配项 Ctrl+D
Select all occurrences 选择所有匹配项 Shift+Ctrl+L
Go to matching bracket 跳转到匹配括号 Shift+Ctrl+\

Basic Operations 基本操作#

Action 操作 Shortcut 快捷键
New line with indentation 新行并缩进 Enter
Undo 撤销 Ctrl+Z
Redo 重做 Ctrl+Y or Ctrl+Shift+Z
Undo selection 撤销选择 Ctrl+U
Copy 复制 Ctrl+C
Cut 剪切 Ctrl+X
Paste 粘贴 Ctrl+V
Action 操作 Shortcut 快捷键
New line with indentation 新行并缩进 Enter
Undo 撤销 Cmd+Z
Redo 重做 Cmd+Y or Cmd+Shift+Z
Undo selection 撤销选择 Cmd+U
Copy 复制 Cmd+C
Cut 剪切 Cmd+X
Paste 粘贴 Cmd+V
Action 操作 Shortcut 快捷键
New line with indentation 新行并缩进 Enter
Undo 撤销 Ctrl+Z
Redo 重做 Ctrl+Y or Ctrl+Shift+Z
Undo selection 撤销选择 Ctrl+U
Copy 复制 Ctrl+C
Cut 剪切 Ctrl+X
Paste 粘贴 Ctrl+V

Delete Operations 删除操作#

Action 操作 Shortcut 快捷键
Delete character left 删除左侧字符 Backspace
Delete character right 删除右侧字符 Del
Delete word left 删除左侧单词 Ctrl+Backspace
Delete word right 删除右侧单词 Ctrl+Del
Delete line 删除行 Shift+Ctrl+K
Action 操作 Shortcut 快捷键
Delete character left 删除左侧字符 Backspace
Delete character right 删除右侧字符 Del
Delete word left 删除左侧单词 Option+Backspace or Ctrl+Cmd+H
Delete word right 删除右侧单词 Option+Del or Fn+Option+Backspace
Delete line 删除行 Shift+Cmd+K
Delete to line start 删除到行首 Cmd+Backspace
Delete to line end 删除到行尾 Cmd+Del or Ctrl+K
Action 操作 Shortcut 快捷键
Delete character left 删除左侧字符 Backspace
Delete character right 删除右侧字符 Del
Delete word left 删除左侧单词 Ctrl+Backspace
Delete word right 删除右侧单词 Ctrl+Del
Delete line 删除行 Shift+Ctrl+K

Line Operations 行操作#

Action 操作 Shortcut 快捷键
Move line up 上移行 Alt+Up
Move line down 下移行 Alt+Down
Copy line up 向上复制行 Shift+Alt+Up
Copy line down 向下复制行 Shift+Alt+Down
Toggle line comment 切换行注释 Ctrl+/
Add line comment 添加行注释 Ctrl+K then Ctrl+C
Remove line comment 移除行注释 Ctrl+K then Ctrl+U
Toggle block comment 切换块注释 Shift+Alt+A
Action 操作 Shortcut 快捷键
Move line up 上移行 Option+Up
Move line down 下移行 Option+Down
Copy line up 向上复制行 Shift+Option+Up
Copy line down 向下复制行 Shift+Option+Down
Toggle line comment 切换行注释 Cmd+/
Add line comment 添加行注释 Cmd+K then Cmd+C
Remove line comment 移除行注释 Cmd+K then Cmd+U
Toggle block comment 切换块注释 Shift+Option+A
Split line 分割行 Ctrl+O
Transpose characters 转置字符 Ctrl+T
Action 操作 Shortcut 快捷键
Move line up 上移行 Alt+Up
Move line down 下移行 Alt+Down
Copy line up 向上复制行 Shift+Alt+Up
Copy line down 向下复制行 Shift+Alt+Down
Toggle line comment 切换行注释 Ctrl+/
Add line comment 添加行注释 Ctrl+K then Ctrl+C
Remove line comment 移除行注释 Ctrl+K then Ctrl+C
Toggle block comment 切换块注释 Shift+Alt+A

Autocomplete 自动完成#

Action 操作 Shortcut 快捷键
Start completion 开始补全 Ctrl+Space
Accept completion 接受补全 Enter or Tab
Close completion 关闭补全 Esc
Navigate completion options 导航补全选项 Up or Down
Action 操作 Shortcut 快捷键
Start completion 开始补全 Ctrl+Space
Accept completion 接受补全 Enter or Tab
Close completion 关闭补全 Esc
Navigate completion options 导航补全选项 Up or Down
Action 操作 Shortcut 快捷键
Start completion 开始补全 Ctrl+Space
Accept completion 接受补全 Enter or Tab
Close completion 关闭补全 Esc
Navigate completion options 导航补全选项 Up or Down

Indentation 缩进#

Action 操作 Shortcut 快捷键
Indent more 增加缩进 Tab or Ctrl+]
Indent less 减少缩进 Shift+Tab or Ctrl+[
Action 操作 Shortcut 快捷键
Indent more 增加缩进 Cmd+]
Indent less 减少缩进 Cmd+[
Action 操作 Shortcut 快捷键
Indent more 增加缩进 Tab or Ctrl+]
Indent less 减少缩进 Shift+Tab or Ctrl+[

Code Folding 代码折叠#

Action 操作 Shortcut 快捷键
Fold code 折叠代码 Ctrl+Shift+[
Unfold code 展开代码 Ctrl+Shift+]
Fold all 全部折叠 Ctrl+K then Ctrl+0
Unfold all 全部展开 Ctrl+K then Ctrl+J
Action 操作 Shortcut 快捷键
Fold code 折叠代码 Cmd+Option+[
Unfold code 展开代码 Cmd+Option+]
Fold all 全部折叠 Cmd+K then Cmd+0
Unfold all 全部展开 Cmd+K then Cmd+J
Action 操作 Shortcut 快捷键
Fold code 折叠代码 Ctrl+Shift+[
Unfold code 展开代码 Ctrl+Shift+]
Fold all 全部折叠 Ctrl+K then Ctrl+0
Unfold all 全部展开 Ctrl+K then Ctrl+J

Multi-cursor 多光标#

Action 操作 Shortcut 快捷键
Add cursor at click position 在点击位置添加光标 Alt+Left Button
Add cursor above 在上方添加光标 Ctrl+Alt+Up
Add cursor below 在下方添加光标 Ctrl+Alt+Down
Add cursors to line ends 在行尾添加光标 Shift+Alt+I
Clear multiple cursors 清除多个光标 Esc
Action 操作 Shortcut 快捷键
Add cursor at click position 在点击位置添加光标 Option+Left Button
Add cursor above 在上方添加光标 Ctrl+Option+Up
Add cursor below 在下方添加光标 Ctrl+Option+Down
Add cursors to line ends 在行尾添加光标 Shift+Option+I
Clear multiple cursors 清除多个光标 Esc
Action 操作 Shortcut 快捷键
Add cursor at click position 在点击位置添加光标 Alt+Left Button
Add cursor above 在上方添加光标 Shift+Alt+Up
Add cursor below 在下方添加光标 Shift+Alt+Down
Add cursors to line ends 在行尾添加光标 Shift+Alt+I
Clear multiple cursors 清除多个光标 Esc

Formatting 格式化#

Action 操作 Shortcut 快捷键
Format document 格式化文档 Shift+Alt+F
Action 操作 Shortcut 快捷键
Format document 格式化文档 Shift+Cmd+F
Action 操作 Shortcut 快捷键
Format document 格式化文档 Ctrl+Shift+I

Search & Navigation 搜索和导航#

Action 操作 Shortcut 快捷键
Open Search 打开搜索 Ctrl+F
Select All 全选 Alt+Enter
Replace All 全部替换 Ctrl+Alt+Enter
Go To Line 跳转到行 Ctrl+G
Next Diagnostic 下一个诊断 F8
Previous Diag. 上一个诊断 Shift+F8
Open Lint Panel 打开Lint面板 Ctrl+Shift+M
Action 操作 Shortcut 快捷键
Open Search 打开搜索 Cmd+F
Select All 全选 Cmd+Enter
Replace All 全部替换 Cmd+Option+Enter
Go To Line 跳转到行 Cmd+G
Next Diagnostic 下一个诊断 F8
Previous Diag. 上一个诊断 Shift+F8
Open Lint Panel 打开Lint面板 Cmd+Shift+M
Action 操作 Shortcut 快捷键
Open Search 打开搜索 Ctrl+F
Select All 全选 Alt+Enter
Replace All 全部替换 Ctrl+Alt+Enter
Go To Line 跳转到行 Ctrl+G
Next Diagnostic 下一个诊断 F8
Previous Diag. 上一个诊断 Shift+F8
Open Lint Panel 打开Lint面板 Ctrl+Shift+M