oh-my-zsh安装方法以及插件主题推荐

oh-my-zsh的Github仓库地址:https://github.com/ohmyzsh/ohmyzsh

安装zsh

oh-my-zsh安装之前必须要先将shell环境切换成zsh

https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH

for centos

1
2
sudo yum update && sudo yum -y install zsh && \
chsh -s $(which zsh)

for debian

1
2
sudo apt install -y zsh && \
chsh -s $(which zsh)

安装 on-my-zsh

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

或者

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

国内安装特别慢,建议使用魔法

插件安装

zsh-autosuggestions

介绍: 可以根据历史记录提供提示命令
github地址: https://github.com/zsh-users/zsh-autosuggestions
安装教程: https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md

1
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
1
plugins=(zsh-autosuggestions)

extract

介绍: 一键解压,不用再去记tar各种命令
github地址: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/extract

不需要安装直接在plugins中增加extract即可

zsh-syntax-highlighting

介绍: 命令高亮提示
github地址: https://github.com/zsh-users/zsh-syntax-highlighting

1
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
1
plugins=( [plugins...] zsh-syntax-highlighting)

git-open

介绍:直接在终端界面打开对应仓库的页面信息

1
git clone https://github.com/paulirish/git-open.git $ZSH_CUSTOM/plugins/git-open

主题

powerlevel10k/powerlevel10k

github地址: https://github.com/romkatv/powerlevel10k

1
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k

然后修改.zshrc

1
ZSH_THEME="powerlevel10k/powerlevel10k"