#Oh-my-zsh
#官方
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
#第三方-国内
zsh -c "$(curl -fsSL 'https://api.host.mintimate.cn/fileHost/public/download/1P0R')"
#使用Oh-my-zsh,默认是使用自动粘贴转义。但是这样容易出差错。为此,如果需要关闭自动转义,可以打开~/.zshrc文件,添加DISABLE_MAGIC_FUNCTIONS=true字段
vim ~/.zshrc
#进一步美化
#仓库地址:https://github.com/romkatv/powerlevel10k
先下载字体并安装:https://github.com/romkatv/powerlevel10k#fonts
mkdir .zsh #在根目录创建单独文件夹方便管理
#官方
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.zsh/powerlevel10k
echo 'source ~/.zsh/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
#官方-国内
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ~/.zsh/powerlevel10k
echo 'source ~/.zsh/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
#若执行失败,赋予权限
chmod 777 .zhsrc
重启终端窗口
#重新进入配置引导
p10k configure
#代码自动补全插件
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
echo 'source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh' >> ~/.zshrc
#语法高亮插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting
echo "source ${(q-)PWD}/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
vim .vimrc #根目录新建文件并编辑
#.vimrc
:set number
syntax on
Linux/Mac 通用
以下来源简书老肖,很棒的一段https://www.jianshu.com/p/8a912dc8de57
# yum or apt
yum install -y zsh
# apt install zsh
git clone --depth=1 https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
chsh -s /bin/zsh
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/plugins/zsh-autosuggestions
git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/plugins/zsh-syntax-highlighting
sed -i "s/plugins=(git)/plugins=(git kubectl docker zsh-autosuggestions zsh-syntax-highlighting)/g" ~/.zshrc
source ~/.zshrc