终端篇(iterm2 + ohmuzsh + pokemon-terminal)

461 阅读1分钟

终端最终样式

安装

安装ohmyzsh

  • 自动安装
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
  • 手动安装
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
  • 设置当前用户使用
chsh -s /bin/zsh

安装插件

  • 查看插件 ~/.oh-my-zsh/plugins
  • 配置插件 ~/.zshrc
plugins=(git textmate ruby autojump osx mvn gradle)
  • 譬如安装自动提示插件
    • cd ~/.oh-my-zsh/plugins
    • git clone https://github.com/zsh-users/zsh-autosuggestions
    • vim ~/.zshrc
    • 新增 zsh-autosuggestions
    • source ~/.zshrc

zsh常见问题

  • 安装zsh后,别名失效 or 需要重复多次source

因为使用的是zsh,而不是bash,所以即使修改~/.bash_profile之后,关闭终端重新打开依然需要重新使用source命令。

vim ~/.zshrc

# 第一行输入
test -f ~/.bash_profile  && source ~/.bash_profile

# 退出后source一下
source ~/.zshrc