zsh因為有更好的介面,所以在使用上非常熱門。本篇主要紀錄怎麼在Chrome上的Secure Shell App上,使用oh-my-zsh:
測試環境:
- Ubuntu 21.04
- Chrome Secure Shell
首先要先安裝zsh:
sudo apt-get install zsh
接著,安裝oh-my-zsh: sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
因為agnoster主題需要powerline的支持,因此還要再安裝powerline:sudo apt-get install fonts-powerline
到這裡,就安裝完成了。接著要更改主題設定:
nano ~/.zshrc
修改ZSH_THEME為"agnoster",完成後儲存。然後輸入zsh
但目前這樣會有亂碼,因為在Secure Shell中也要設定,打開Options在Text font family加上"Source Code Pro,還有Custom CSS (URI)輸入https://cdn.jsdelivr.net/gh/wernight/powerline-web-fonts@ba4426cb0c0b05eb6cb342c7719776a41e1f2114/PowerlineFonts.css完成之後就可以看到正確顯示的agnoster主題了。
同場加映1:好用的plugins: zsh-autosuggestions
- 安裝:
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
- 修改~/.zshrc在plugins中加上zsh-autosuggestions
同場加映2:macOS的terminal也可以使用,參考這篇
參考:
- Installing ZSH: https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH
- Oh My Zsh: https://github.com/ohmyzsh/ohmyzsh
- Powerline: https://github.com/powerline/powerline
- powerline-web-fonts: https://github.com/wernight/powerline-web-fonts
- zsh-autosuggestions: https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md
沒有留言:
張貼留言