最近也是安排上了Mac mini m4,但是第一次使用macOS還不太熟悉。最近配置了macOS預設的終端zsh,恰巧我的Arch Linux也是使用的zsh,因此這裡簡單所說一下配置過程。
zsh插件:
- zsh-syntax-highlighting:高亮顯示
- zsh-autosuggestions:自動補全命令
- powerlevel10k:終端主題
配置:
首先我的插件是保存在了~/.zsh/plugins/下,然後需要clone:
1 2 3 4 5 6 7 8 9 10 11 12
| mkdir -p ~/.zsh/plugins/
cd ~/.zsh/plugins/
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
git clone https://github.com/zsh-users/zsh-autosuggestions.git
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git
|
然後編輯.zshrc設定檔:
1 2 3 4 5 6 7 8 9 10 11
| # 載入語法高亮 source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# 載入自動建議 source ~/.zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# 載入 Powerlevel10k 主題 source ~/.zsh/plugins/powerlevel10k/powerlevel10k.zsh-theme
# 可選:設置 Powerlevel10k 的配置嚮導(首次啟動時會自動運行) [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
這樣退出終端重新第一次進入就會進行powerlevel10k主題的配置,按照步驟即可。如果需要重新配置,只需rm -rf ~/.p10k.zsh,重新進入終端配置即可。