
現在大部份的Linux發行版,都是預設使用bash,但是大部份的工程師都會改為zsh來使用,因為功能又強,外觀又炫。
zsh安裝
首先將zsh安裝起來,含必要套件
sudo apt install -y zsh git curl wget
然後將zsh設定成為預設的shell
sudo chsh -s $(which zsh) $(whoami)
然後登出在重新登入一次就可以了。但是看起來好像也沒有很炫啊….
別急,讓我們繼續下去
安裝oh-my-zsh
oh-my-zsh是zsh的一套框架,可以省去很多的設定
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
安裝powerlevel10k佈景主題及好用的插件
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
好用插件
1. zsh-completions
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions
2. zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
3. zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
修改~/.zshrc
ZSH_THEME=”powerlevel10k/powerlevel10k”
plugins=(git zsh-completions zsh-autosuggestions zsh-syntax-highlighting)
輸入source .zshrc生效或重新登入也行。
第一次使用會有設定的問答選項,按上面說明回答即可,不清楚的就選recommand的項目。以後還能透過p10k configure修改。