Linux-zsh使用

Linux-shell之zsh

安装oh-my-zsh

  1. 安装zsh
1
sudo apt install zsh
  1. 安装 oh-my-zsh
1
2
wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
sh install.sh
  • 连接失败的可以直接去下载 install.sh 安装
  1. 设置默认
  • 查看shell
1
cat /etc/shells

image-20210926202200305

  • 设置默认为zsh
1
chsh -s /bin/zsh

配置zsh

  1. 主题
1
2
# 修改配置文件
vim ~/.zshrc
  • 找到ZSH_THEME="random"把random改为自己喜欢的主题
  1. 安装插件
1
2
3
4
5
6
7
8
9
cd ~/.oh-my-zsh/plugins
git clone https://github.com/zsh-users/zsh-autosuggestions
vim ~/.zshrc

# 找到plugins 添加 zsh-autosuggestions
plugins=(
# other plugins...
zsh-autosuggestions
)
  • autojump: 根据你的历史记录,快速跳转

image-20210929114456664

1
2
3
4
git clone git://github.com/joelthelion/autojump.git
cd autojump
python ./install.py
# 安装完成后按照提示在 .zshrc 配置文件中添加内容