配置一个漂亮的终端
-
效果
最后效果
下载 iTerm 2 官网
https://www.iterm2.com/
安装 oh-my-zsh 官网
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
更换默认的 shell
- 终端执行命令
chsh -s /bin/zsh
- 更换zsh之后默认启动执行脚本变为了~/.zshrc
如果你之前使用的.bash_profile需要:
修改~/.zshrc文件,在其中添加:source ~/.bash_profile 和 source ~/.bashrc
更换 agnoster 主题
- 打开.zshrc文件
open ~/.zshrc
- 修改
ZSH_THEME="agnoster"
- 保存重新打开 iTerm 2
下载 Powerline fonts 字体 官网
- clone
git clone https://github.com/powerline/fonts.git --depth=1
- install
cd fonts
./install.sh
- clean-up a bit
cd ..
rm -rf fonts
修改 iTerm 2 配置
-
进入 Preferences... Profiles Text Font 选择 Powerline 字体
选择 Powerline 字体 -
修改 Solarized 配色方案
修改 Solarized 配色方案
去掉前面的用户名称
- 打开agnoster.zsh-theme文件
open ~/.oh-my-zsh/themes/agnoster.zsh-theme
- 注释 prompt_context
build_prompt() {
RETVAL=$?
prompt_status
prompt_virtualenv
# prompt_context
prompt_dir
prompt_git
prompt_bzr
prompt_hg
prompt_end
}
- 保存重新打开 iTerm 2
网友评论