Mac Terminal 终端 配置 zsh
Mac 自带 zsh,还是比较方便的哈
首先,把 Terminal 的 shell 改一下:chsh -s /bin/zsh
修改下你的 Terminal 的 ‘偏好设置’
oh-my-zsh 安装
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.zshrc ~/.zshrc.orig
(此步可选)cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
zsh-autosuggestions 安装自动提示
git clone git://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
- 编辑 .zshrc 添加 source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
- 执行
source .zshrc
添加主机名
vim ~/.oh-my-zsh/themes/robbyrussell.zsh-theme
注释原来的并添加下一句:
PROMPT='${ret_status}%M%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
主题
编辑 .zshrc
修改 ZSH_THEME=robbyrussell
执行source .zshrc
oh-my-zsh 不能更新方法
- cd ~/.oh-my-zsh/
- git add .
- git commit -m “commit message”
- upgrade_oh_my_zsh