Powerline 是一個終端機的外掛小工具,支援各種常見的 Shell 與 Vim,可以讓命令提示字元與 Vim 的狀態列更美觀易讀。
sudo apt-get install powerline
wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
mv PowerlineSymbols.otf ~/.fonts/
fc-cache -vf ~/.fonts/
mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/
在 ~/.bashrc
中加入下列程式碼
POWERLINE_SCRIPT=/usr/share/powerline/bindings/bash/powerline.sh
if [ -f $POWERLINE_SCRIPT ]; then
source $POWERLINE_SCRIPT
fi
修改設定,以顯示 git branch
~/.config/powerline/config.json
shell
內的 theme
的設定值由 default
改為 default_leftonly
"shell": {
"colorscheme": "default",
"theme": "default_leftonly",
"local_themes": {
"continuation": "continuation",
"select": "select"
重新開啟終端機,即可看到 Powerline 的效果
在 ~/.vimrc
中加入下列設定
set laststatus=2
set t_Co=256