iTerm2官方下載地址 ,直接下載安裝便可。html
1.經過cat /etc/shells
命令能夠查看當前系統能夠使用哪些shell;nginx
# 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
2.經過echo $SHELL命令能夠查看咱們當前正在使用的shell;git
# Mac系統中默認的shell爲bash shell /bin/bash
3.若是當前的shell不是zsh,咱們能夠經過chsh -s /bin/zsh命令能夠將shell切換爲shell之zsh,終端重啓以後便可生效。github
4.將shell切換爲zsh以後,咱們就能夠安裝Oh My ZSH了
官方推薦的安裝方法爲:shell
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
5.安裝成功後,以下圖:vim
oh my zsh 默認安裝在:~/.oh-my-zsh
目錄下,配置文件默認爲:~/.zshrc
。
輸入vim ~/.zshrc
,修改 zsh 的配置文件,在文件的最後alias中,添加 alias 快捷命令名="實際命令"
便可。bash
配置完成後須要執行一下命令,而後重啓item2:curl
source ~/.zshrc
以後若是你在 item2 中再輸入 nginxconfig
這個命令就能夠快捷使用vim打開nginx的配置文件了(至關於執行了vim /usr/local/etc/nginx/nginx.conf
)字體
Oh My Zsh提供的全部主題在線預覽:
https://github.com/robbyrussell/oh-my-zsh/wiki/Themesurl
大部分主題能夠經過如下操做直接更改:
1.進入配置文件
vi ~/.zshrc
2.將ZSH_THEME設置成你想要設置的themes,可從上面的themes列表中選擇
ZSH_THEME="agnoster"
3.更新配置
source ~/.zshrc
agnoster主題可否設置成功,還依賴於如下東西:
下載完成以後解壓,在iTerm2的Preferences
——Profiles
——colors
——Load Presets
中便可設置終端配色爲Solarized Dark
;
# clone git clone https://github.com/powerline/fonts.git --depth=1 # install cd fonts ./install.sh # clean-up a bit cd .. rm -rf fonts
Preferences
——Profiles
——Text
中同時將Regular Font
和Non—ASCII Font
設置爲Meslo LG M DZ Regular for Powerline
或者Meslo LG M DZ for Powerline
便可;