環境
Arch Linux + KDE Plasma
安裝zsh
yay -S zsh
更改默認終端
chsh -s /bin/zsh
安裝oh-my-zsh-git
archlinuxcn源有打好的包,或者使用AUR安裝。
yay -S oh-my-zsh-git
默認配置
cp /usr/share/oh-my-zsh/zshrc ~/.zshrc
這時候打開終端軟件,應該就會默認進入zsh了
安裝插件
autojump 跳轉目錄
yay -S autojump
命令高亮現和自動建議補全
yay -S zsh-syntax-highlighting zsh-autosuggestions
這兩個是zsh插件,使用上面的方式配置是不行的,因為oh-my-zsh找不到這兩個插件(會報plugin not found)。為此我們要進行一下特殊處理,創建這兩個插件的符號鏈接到oh-my-zsh的自定義插件目錄
sudo ln -s /usr/share/zsh/plugins/zsh-syntax-highlighting /usr/share/oh-my-zsh/custom/plugins/
sudo ln -s /usr/share/zsh/plugins/zsh-autosuggestions /usr/share/oh-my-zsh/custom/plugins/
插件配置
同樣是打開.zshrc文件,找到plugins=(git),在這里增加自己想要的插件即可,多個插件名稱之間使用空格或者換行分開(不能使用逗號)。
vim ~/.zshrc
plugins=(
sudo
git
autojump
zsh-syntax-highlighting
zsh-autosuggestions
)
安裝powerlevel10k樣式
安裝Nerd Fonts字體
下載字體
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts && curl -fLo "Droid Sans Mono for Powerline Nerd Font Complete.otf" https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf
緩存字體
fc-cache -vf ~/.local/share/fonts/
查看是否安裝成功
fc-list | grep -i droid
/home/kylin/.local/share/fonts/Droid Sans Mono for Powerline Nerd Font Complete.otf: DroidSansMonoForPowerline Nerd Font:style=Book
設置終端字體

下載powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k
修改zsh主題
ZSH_THEME="powerlevel10k/powerlevel10k"
source ~/.zshrc
重啟終端即可進入配置p10k
**p10k configure 以直接從終端訪問內置配置向導 **

注意事項
配置成功后只顯示一行
Instant Prompt Mode 選擇off
