Iterm2 常用快捷键

image-20240429133734551

标签控制

1
2
3
4
5
6
7
8
9
新建标签:command + t

关闭标签:command + w

切换标签:command + 数字 command + 左右方向键

切换全屏:command + enter

查找:command + f

分屏控制

1
2
3
4
5
6
7
8
9
垂直分屏:command + d

水平分屏:command + shift + d

切换屏幕:command + option + 方向键 command + [ 或 command + ]

查看历史命令:command + ;

查看剪贴板历史:command + shift + h

光标操作(常用)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
清除当前行(实际上是光标前全部内容):ctrl + u

删除前一个字符|删除后一个字符:ctrl + h | ctrl + h

按单词往前删除(推荐记忆):ctrl + w

删除光标后所有内容:ctrl + k

到行首(尾):ctrl + a/e

光标前进后退:-> ctrl + f | <- ctrl + b

上一条命令|下一条命令:ctrl + p/n

可以搜索的历史命令:ctrl + r

清屏:command + r | ctrl + l | 我自己一般手动clear

上面就是我整理的一些快捷键。

下面就是大整合:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
新建标签:command + t

关闭标签:command + w

切换标签:command + 数字 command + 左右方向键

切换全屏:command + enter

查找:command + f

垂直分屏:command + d

水平分屏:command + shift + d

切换屏幕:command + option + 方向键 command + [ 或 command + ]

查看历史命令:command + ;

查看剪贴板历史:command + shift + h

清除当前行:ctrl + u

到行首:ctrl + a

到行尾:ctrl + e

前进后退:ctrl + f/b (相当于左右方向键)

上一条命令:ctrl + p

搜索命令历史:ctrl + r

删除当前光标的字符:ctrl + d

删除光标之前的字符:ctrl + h

删除光标之前的单词:ctrl + w

删除到文本末尾:ctrl + k

交换光标处文本:ctrl + t

清屏1:command + r

清屏2:ctrl + l

自带有哪些很实用的功能/快捷键

⌘ + 数字在各 tab 标签直接来回切换

选择即复制 + 鼠标中键粘贴,这个很实用

⌘ + f 所查找的内容会被自动复制

⌘ + d 横着分屏 / ⌘ + shift + d 竖着分屏

⌘ + r = clear,而且只是换到新一屏,不会想 clear 一样创建一个空屏

ctrl + u 清空当前行,无论光标在什么位置

输入开头命令后 按 ⌘ + ; 会自动列出输入过的命令

⌘ + shift + h 会列出剪切板历史

可以在 Preferences > keys 设置全局快捷键调出 iterm,这个也可以用过 Alfred 实现