1、安装zsh

1
sudo apt-get install zsh

2、把默认的Shell改成zsh

1
chsh -s /bin/zsh

3、安装Git

1
sudo apt-get install git

4、安装oh-my-zsh

为什么要安装,用于快速配置zsh。

官网:http://ohmyz.sh/

1
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

临时代理

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#终端代理
export http_proxy=https://10.0.0.1:11223
export https_proxy=https://10.0.0.1:11223
#关闭代理
unset http_proxy
unset https_proxy

#git代理
git config --global http.proxy '10.0.0.1:11223'
git config --global https.proxy '10.0.0.1:11223'
#查看代理
git config --global http.proxy
#删除代理
git config --global --unset http.proxy
git config --global --unset https.proxy

插件:

语法高亮插件

官网:https://github.com/zsh-users/zsh-syntax-highlighting

安装:

1
2
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc

生效:

1
source ~/.zshrc

安装autojump自动跳转插件

官网:https://github.com/wting/autojump

安装:

1
sudo apt-get install autojump

配置教程:cat /usr/share/doc/autojump/README.Debian

配置:

1
2
3
vim .zshrc
#在最后一行加入,注意点后面是一个空格
. /usr/share/autojump/autojump.sh

生效:

1
source ~/.zshrc

配置主题

官方主题参考:https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes

1
sudo vim ~/.zshrc

找到ZSH_THEME=”robbyrussell”,修改为:ZSH_THEME=”yes”;

生效:

1
source ~/.zshrc