[Debian] 安裝 powerline
#Step 01 –
1.先保證python版本在3.7
$ python --version
2.安裝pip,並通過pip安裝powerline
$ sudo apt install pip
$ pip install powerline-status
安裝/配置字體
說起樣式怎能少了字體呢?而且Powerline中還用到特殊的字符,需要特定的字體來配合才能達到最佳顯示效果。
$ git clone https://github.com/powerline/fonts &&
./fonts/install.sh
然後到Profiles->Profile Preferences選擇合適的xxx for powerline的字體即可。
Powerline for BASH
安裝好powerline後,就是配置.bashrc了。
$ cat >> .bashrc << EOF
source $(pip show powerline-status | awk '/Location:/{print $2 "/powerline/bindings/bash/powerline.sh"}')
EOF
或
if [ -f `which powerline-daemon` ]; then
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
fi
if [ -f /usr/local/lib/python3.7/dist-packages/powerline/bindings/bash/powerline.sh ]; then
source /usr/local/lib/python3.7/dist-packages/powerline/bindings/bash/powerline.sh
fi
#Step 02 –
Powerline 4 VIM
$ cat >> .vimrc << EOF
set rtp+=$(pip show powerline-status | awk '/Location:/{print $2 "/powerline/bindings/vim"}')
" These lines setup the environment to show graphics and colors correctly.
set nocompatible
set t_Co=256
let g:minBufExplForceSyntaxEnable = 1
python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup
if ! has('gui_running')
set ttimeoutlen=10
augroup FastEscape
autocmd!
au InsertEnter * set timeoutlen=0
au InsertLeave * set timeoutlen=1000
augroup END
endif
set laststatus=2 " Always display the statusline in all windows
set guifont=Inconsolata\ for\ Powerline:h14
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
EOF
#Step 03 –
#Step 04 –
#Step 05 –
#Step 06 –
#Step 07 –
#Step 08 –
#Step 09 –
#Step 10 –
沒有留言:
張貼留言