Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.
Powerline是vim的一个状态行扩展,提供状态行和命令给一些其他的程序,包括zsh,bash,tmux,IPython,Awesome以及Qtile
下面是几个官方的截图,但是这是vim-powerline的
而我们要的是bash-powerline
用到的便是powerline-shell
1.clone
git clone https://github.com/milkbikis/powerline-shell
2.安装
cd powerline-shell
cp config.py.dist config.py
python install.py
3.python2.6
sudo pip install argparse
创建链接
ln -s <path/to/powerline-shell.py> ~/powerline-shell.py
将下面的代码添加到.bashrc
中或者.bash_profile
function _update_ps1() {
export PS1="$(~/powerline-shell.py $? 2> /dev/null)"
}
export PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
如果是zsh添加到.zshrc
function powerline_precmd() {
export PS1="$(~/powerline-shell.py $? --shell zsh 2> /dev/null)"
}
function install_powerline_precmd() {
for s in "${precmd_functions[@]}"; do
if [ "$s" = "powerline_precmd" ]; then
return
fi
done
precmd_functions+=(powerline_precmd)
}
install_powerline_precmd
围观我的Github Idea墙, 也许,你会遇到心仪的项目