Shortcut

输入

Shift 6 输入表情

option ; 省略号

通用快捷键

删除

字符:往前删除一个字符<c-h>;往后删除一个字符<c-d>.

词组:往前删除一个单词<c-w>.

整行:删除到行首<c-u>;删除到行尾<c-k>

粘贴

粘贴剪切板内容:<c-y>

移动

行内移动:移动到行首<c-a>;移动到行尾<c-e>

方向键:向上<c-p>; 向下<c-n>;向左<c-f>;向右<c-b>

macOS

编辑:在当前位置插入新行C-O

移动:内容居中显示C-L;移动到文档的始末:⌘↑/⌘↓

查找:查找内容⌘F;查找下一项⌘G;上一项Shift-⌘-G.

窗口

  • 隐藏: 隐藏当前app的窗口⌘H;隐藏其它app的窗口⌥⌘H.
  • 最小化:最小化当前窗口⌘M 最小化所有窗口⌥-⌘-M
  • 最大化:全屏显示⌃⌘F

访达

  • 往返:跳转到上一个目录⌘[;跳转到下一个目录⌘]
  • 路径:返回上级目录 ⌘↑; 在新窗口中打开上级目录⌘⌃–↑
  • 打开:打开所选项目⌘↓
  • 链接:⌘L 创建链接; ⌘R 显示链接对应的原文件
  • 复制:⌥⌘-V 移动剪切板内容 Move the files in the Clipboard from their original location to the current location.

iTerm2

窗口

  • 分屏:上下分屏⌘⇧D:左右分屏 ⌘D
  • 调整大小:最大化pane⌘⇧Enter;最大化窗口:⌘Enter; 重置pane窗口大小:⌃⌘Arrow
  • 将命令发送打所有窗口:⌘⌥I

其它

Shortcut Function
⌥< Move to the beginning (top) of the history list.
⌥> Move to the end (bottom) of the history list, i.e., the current command line.
⌃r Reverse incremental search. This searches incrementally from the current command line up the history list.
⌥p Reverse search, nonincremental. With this key, type in the search string and press enter before the search is performed.
⌥n Forward search, nonincremental.
⌃o Execute the current item in the history list and advance to the next

Moving Faster

A lot of shell shortcuts work in iterm and it's good to learn these because arrow keys, home/end keys and Mac equivalents don't always work. For example + Left Arrow is usually the same as Home (go to beginning of current line) but that doesn't work in the shell. Home works in many apps but it takes you away from the home row.

Function Shortcut
Set Mark + M
Jump to Mark + J
Cursor Jump with Mouse (shell and vim - might depend on config) + Left Click

Copy actions goes into the normal system clipboard which you can paste like normal.

Search the Command History

Function Shortcut
End the search at current history entry ⌃ + Y
Cancel the search and restore original line ⌃ + G
updatedupdated2023-06-052023-06-05
Update https-ca.md