install:: brew install iterm2 --cask github::


Preferences

General

  • Selection
    • Applications in terminal may access clipboard: 选中后拷贝到剪贴板

Appearance

  • Windows
    • Hide scrollbars: 取消滚动条

Profiles

  • profile Name
  • Colors
    • Color Presets: 选择主题
  • Windows - Window Appearance: 窗口外观相关 - Transparency: 透明度 - keep background colors opaque: 保持背景颜色不透明 - Blur: 模糊 - Background Image: 背景图片 - Settings for New Windows: 窗口设置 - Style - Full-Width Top of Screen: 顶部显示,并占满宽度 - No Title Bar: 隐藏标题栏 - Screen - Screen width Cursor: - Space - Current Spce: 只显示当前屏幕
  • Keys
    • A hotkey opens a dedicated window with this profile: 为指定窗口设置热键

常用配置

任意界面顶部呼出窗口

    - 新建配置
    - 透明:  ((61af1079-1222-496a-b679-df09972e7c01))
    - 快捷键:  ((61af14c1-1e8a-48b5-943a-fa5867500439))

首次运行时执行指定命令

  • Preferences -> Profiles
    • General -> Command
      • Send text at start: tmux at -d -t envi || tmux new -s envi
    • Keys -> Configure Hotkey Window
      • 勾选 Double-Tap Key
    • Window —> Style # 隐藏标题
      • No Title
    • Text —> Cursor # 设置光标形状
      • Vertical Bar

iTerm2 支持触控 ID

# 编辑 pam_tid.so 文件
sudo vim /etc/pam.d/sudo
 
# 在文件第二行增加
auth sufficient pam_tid.so

添加完成后打开 iTerm2 配置 Preferences -> Advanced,搜索 Allow sessions to survive logging out and back in,把值改为 no

主题

使用 powerlevel10k

快捷键

  • 窗口
    • Command + N: 新窗口
    • Command + Shift + W: 关闭窗口
    • Command + D: 垂直分割
    • Command + Shift + D: 水平分割
    • Command + Enter: 全屏切换
  • 标签
    • Command + T: 新标签页
    • Command + 1~9:标签切换
    • Command + W: 关闭标签
  • 编辑
    • Control + l: 清屏
    • Control + u: 清除当前行
    • Control + a: 行首
    • Control + e: 行末
    • Control + p:上一条命令
    • Control + n:下一条命令
    • Control + h: 删除字
    • Control + w: 删除词
  • Command + Shift + C: 复制模式
  • Command + Shift + h: 剪贴板历史
  • Command + Z: 撤销关闭的会话
  • Command + U: 透明度切换
  • Command + /: 寻找光标
  • Command + Shift + O: 快速打开
  • Command + Option + B: 重放
  • Command + Shift + B: 打开工具栏
  • 技巧
    • Command + Option + 鼠标左键: 矩形复制