iTerm2官方下载
查看当前系统shell
cat /etc/shells
命令结果:
# List of acceptable shells for chpass(1).# Ftpd will not allow users to connect who are not using# one of these shells./bin/bash/bin/csh/bin/ksh/bin/sh/bin/tcsh/bin/zsh
使用 echo $SHELL 查看当前系统使用的shell
echo $SHELL
(1)一般mac自带的zsh不是最新版的,可以更新到最新版: brew install zsh;(2) zsh --version 命令查看 zsh 的版本;(3)修改默认 Shell,在 /etc/shells 文件中加入如下一行 /usr/local/bin/zsh然后运行命令 chsh -s /usr/local/bin/zsh;或者通过命令 chsh -s $(which zsh)设置;
(1)一般mac自带的zsh不是最新版的,可以更新到最新版: brew install zsh;
brew install zsh
(2) zsh --version 命令查看 zsh 的版本;
zsh --version
(3)修改默认 Shell,在 /etc/shells 文件中加入如下一行 /usr/local/bin/zsh然后运行命令 chsh -s /usr/local/bin/zsh;或者通过命令 chsh -s $(which zsh)设置;
/usr/local/bin/zsh
chsh -s /usr/local/bin/zsh
chsh -s $(which zsh)
安装Oh My Zsh
(1)项目主页: https://github.com/robbyrussell/oh-my-zsh(2)安装oh my zsh: sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"(3) 为什么使用zsh
(1)项目主页: https://github.com/robbyrussell/oh-my-zsh
https://github.com/robbyrussell/oh-my-zsh
(2)安装oh my zsh: sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
(3) 为什么使用zsh
设置agnoster主题
(1)修改 vim ~/.zshrc,然后把里面 ZSH_THEME 的值改为 ZSH_THEME="agnoster"(2)安装这个主题需要额外的font支持 font设置(3) 设置配色,在iTerm2的Preferences——>Profiles——>colors——>Load Presets——>Solarized Dark即可设置终端配色(4)修改字体,在iTerm2的Preferences——>Profiles——>Change font——> Source code pro for powerline
(1)修改 vim ~/.zshrc,然后把里面 ZSH_THEME 的值改为 ZSH_THEME="agnoster"
vim ~/.zshrc
ZSH_THEME
ZSH_THEME="agnoster"
(2)安装这个主题需要额外的font支持 font设置
(3) 设置配色,在iTerm2的Preferences——>Profiles——>colors——>Load Presets——>Solarized Dark即可设置终端配色
(4)修改字体,在iTerm2的Preferences——>Profiles——>Change font——> Source code pro for powerline
引入.bash_profile配置 找到zsh的配置文件 .zshrc ,在文件的尾部加入
.bash_profile
.zshrc
source .bash_profile
Cousine for Powerline