Skip to content

zsh

Ubuntu 18.04.3 LTS 安装 zsh

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
apt install zsh

zsh --version
# zsh 5.4.2 (x86_64-ubuntu-linux-gnu)

git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh


# 改变默认的Shell
chsh -s /bin/zsh

# 最后重启终端

centos

1
2
yum install -y zsh
yum install -y git
1
2
$ which zsh
/usr/bin/zsh

/etc/shells 中添加一行 /usr/bin/zsh

ohmyzsh

https://github.com/ohmyzsh/ohmyzsh

安装:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

进入大型git仓库卡顿

是因为在进入目录的时候,oh-my-zsh会去获取git的更新信息,当仓库很大的时候就会非常慢了

解决方案:

设置 oh-my-zsh 不读取文件变化信息(在 git 项目目录执行下列命令)

1
$ git config --add oh-my-zsh.hide-dirty 1

如果你还觉得慢,可以再设置 oh-my-zsh 不读取任何 git 信息

1
$ git config --add oh-my-zsh.hide-status 1

如果想恢复显示,可以将1改为0,或者 git config --remove-section oh-my-zsh