Ⅰ. 插件描述
Powerline-style Bash prompt in pure Bash script. See also https://github.com/riobard/zsh-powerlineⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'riobard/bash-powerline'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'riobard/bash-powerline'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'riobard/bash-powerline'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/riobard/bash-powerline
Ⅳ. 文档说明
# bash-powerline
Powerline for Bash in pure Bash script.

Features
- Git: show branch name, tag name, or unique short hash.
- Git: show "*" symbol with uncommited modifications.
- Git: show "↑" symbol and number of commits ahead of remote.
- Git: show "↓" symbol and number of commits behind remote.
- Platform-dependent prompt symbols.
- Color-coded prompt symbol according to previous command execution status.
- Use Bash builtin when possible to reduce delay. Delay sucks!
- No need for patched fonts.
Installation
Download the Bash script
curl https://raw.githubusercontent.com/riobard/bash-powerline/master/bash-powerline.sh > ~/.bash-powerline.sh
And source it in your .bashrc
source ~/.bash-powerline.sh
For best result, use [Solarized
colorscheme](https://github.com/altercation/solarized) for your terminal
- Or hack your own colorscheme by modifying the script. It's really
easy.
Why?
This script is inspired by
powerline-shell, which is
implemented in Python. Python scripts are much easier to write and maintain than
Bash scripts, but invoking Python interpreter introduces noticable delay to
- I hate delays, so I ported just the part I need to pure Bash script.
The other reason is that I don't like the idea of patching fonts. The
font patching mechanism from the original Powerline does not work with the
bitmap font (Apple Monaco without anti-aliasing) I use on non-retina screens.
I'd rather stick with existing unicode symbols.
See also
- zsh-powerline: Same thing but for
Zsh. - powerline: Unified Powerline
written in Python. This is the future of all Powerline derivatives. - vim-powerline: Powerline in Vim
writtien in pure Vimscript. Deprecated. - tmux-powerline: Powerline for Tmux
written in Bash script. Deprecated. - powerline-shell: Powerline for
Bash/Zsh/Fish implemented in Python. Might be merged into the unified
Powerline.
- emacs powerline: Powerline for
Emacs