iTerm2 - macOS Terminal Replacement

知乎借鉴:https://zhuanlan.zhihu.com/p/112383265

brew 安装 iTerm2

brew install --cask iterm2

常用快捷键

http://static.kancloud.cn/shellway/iterm2/259185

iTerm2 设置

iTerm2光标按照单词快速移动设置

  1. iterm2 禁用鼠标选择复制

    Untitled

  2. 关闭每日提示

    Preferences > Advanced > 搜索 Tip of the Day > Disable the Tip of the Day 改为 Yes

    Untitled

  3. 资源状态栏

    你可以在iterm2中使用快捷键command + ,或者菜单栏打开首选项,进行设置

    Untitled

    点击configure status bar将需要的托放在下面既可

  4. title 显示路径,Profiles→General→Basics 中的title勾选PWD

    Untitled

  1. 解决 vim 选中文字不能复制的问题

    用vim打开文件,选中文字用command + c复制,不能复制

    iterm2 > Preferences > Profiles > Terminal > Enable mouse reporting 去掉勾选

    Untitled

iTerm2 配色

主题地址:

Iterm Themes - Color Schemes and Themes for Iterm2

GitHub 地址:https://github.com/mbadolato/iTerm2-Color-Schemes

安装 oh-my-zsh

官网提供的安装方式:

sh -c "$(curl -fsSL <https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh>)"

cd .oh-my-zsh

cp templates/zshrc.zsh-template ../.zshrc

这种方式一般会因为 github 登陆失败(443)而无法安装,因此推荐采用下面的方式安装:

克隆 oh-my-zsh

git clone <https://gitee.com/mirrors/oh-my-zsh> ~/.oh-my-zsh

备份 ~/.zshrc

cp ~/.zshrc ~/.zshrc.bak 

将 .oh-my-zsh文件里的的 zshrc.zsh-template文件复制成 zshrc 文件

cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

最后将~/.zshrc.bak的内容复制到~/.zshrc中