Skip to Content
OSLinuxOh My Zsh

安装 zsh 和 oh my zsh

apt install -y zsh chroma git curl echo y | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" zsh ## 需要先安装上面安装 oh my zsh,再复制跑一边

获取 zsh 插件

# 主题 git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k # 插件 git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions --depth=1 git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting --depth=1 # autojump git clone https://github.com/wting/autojump.git --depth=1 cd autojump ./install.py cd .. && rm -rf autojump

配置 zsh 和按自己喜好添加其他配置

sed -i 's/ZSH_THEME="robbyrussell"/# ZSH_THEME="robbyrussell"\nZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc sed -i 's/plugins=(git.*?\)/plugins=(git docker colorize zsh-autosuggestions zsh-syntax-highlighting)/' ~/.zshrc
cat <<EOL >> ~/.zshrc [[ -s /root/.autojump/etc/profile.d/autojump.sh ]] && source /root/.autojump/etc/profile.d/autojump.sh autoload -U compinit && compinit -u alias sdr="systemctl daemon-reload" alias sr="systemctl restart" alias g="git" alias gc="git commit" alias gs="git stash" alias gr1="git reset --soft HEAD~1" alias gp="git pull" alias ggp="git push" alias gaa="git add ." alias gch="git checkout" alias nr="npm run" alias br="bun run" alias bx="bunx" alias py="python" alias ard="aria2c --summary-interval=10 -x 3 --allow-overwrite=true -Z" alias jl="journalctl -o cat -fu" EOL source ~/.zshrc
Last updated on