[Linux]程序员基本的shell配置

环境:Ubuntu 20.04

使用zsh

sudo apt-get install zsh
sudo chsh -s $(which zsh)

安装oh-my-zsh

sh -c "$(wget -O- https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"

安装主题:p10k

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

// 修改如下行
// 修改前
ZSH_THEME="robbyrussell"
// 修改后
ZSH_THEME="powerlevel10k/powerlevel10k"

安装插件:zsh-autosuggestions和zsh-syntax-highlighting

git clone git://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
echo "source ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
vim ~/.zshrc

// 修改如下行
// 修改前
plugins=(git)
// 修改后
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

预览图

posted @ 2021-11-06 11:17  herrhu  阅读(88)  评论(0编辑  收藏  举报