iTerm2
1、新用户的亮点
iTerm 2 作为 Mac 上的终端软件,完全可以替代电脑自带的终端,具有强大的扩展功能。
1) 选择文本
- 选中即复制
- 鼠标直接选择文本,双击选中单词、三击选中行
- Cmd + f:输入文字,按 Tab 键向后选中,Tab + Shift 向前选中
- Copy Mode
- You can bind keystrokes to create and adjust selections. In Prefs > Profiles > Keys you can assign keys to move the beginning or end of the selection by a single character, word, or line. No such keys are bound by default.
2) 位置标记
cmd - shift - M,标记当前终端的位置, cmd - shift J:复原标记位置。
3)tab 里存在的文字,输入前几个字符 按 cmd + ;,将给出提示。
4)粘贴 历史
复制的文字都被添加到粘贴历史,使用 cmd-shift-H 访问粘贴历史。可以设置将粘贴历史存到磁盘:Preferences > General > Save copy/paste history to disk
5) Cmd + option + /: 弹出最近进入的目录列表,根据使用频率排序
6) Cmd + option + A: 命令执行完毕给出 alert 通知弹框提示
这个功能需要安装 Shell Integration, 安装步骤:菜单栏iTerm2 -> Shell Integration 。安装后重启 iTerm 2,输入 Cmd + option + A 后终端右上角出现一个眼睛图标,其它命令执行完毕后会有系统通知。
7) 输入打头几个字母,然后输入command+; iterm2将自动列出之前输入过的类似命令。
2、点击
- 自定义点击
Preferences > Pointer,推荐使用three-finger tap对应smart selection,三指点击会智能选中内容。 - 按住
cmd点击链接,链接将打开, cmd - 点击文件名,文件/文件夹 会打开;鼠标选择时按住 cmd-option,产生矩形选中;数字右击显示 16 进制。 - 右键点击数字显示 16 进制。
3、快捷键
Cmd + ←/→:切换 Tab(当有多个 Tab 时)Cmd + 数字:直接切换 Tab(注意快捷键是否被占用)Cmd + option + 数字:定位到 WindowCmd + shift + ;:弹出使用过的全部命令Cmd + /: 显示光标位置Cmd + option + 上、下:选中 上、下个命令
4、Profiles
Many settings are stored in profiles. A profile is a named collection of settings, and you can have as many of them as you like. Most users only have one profile, but if you find that you often connect to different servers, they may be useful for you. A key feature of a profile is that you can associate a command with it that is run when it begins. For instance, if you often ssh to a particular host, you could create a profile with the command "ssh example.com" to automate that process.