Ⅰ. 插件描述
git-flow-format is a plugin for vim-airline, which formats a Git Flow branch name in order to shorten the prefixes and take up less space in your status line.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'renyard/git-flow-format'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'renyard/git-flow-format'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'renyard/git-flow-format'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/renyard/vim-git-flow-format
Ⅳ. 文档说明
# Vim git-flow-format
git-flow-format is a plugin for vim-airline, which formats a Git Flow branch name
in order to shorten the prefixes and take up less space in your status line.
This is best shown with a couple of examples:
feature/new_thing --> F:new_thing
release/v1.0.0 --> R:v1.0.0
Installation
git-flow-format can be installed with Vundle or
Pathogen in the normal way.
Vundle
Add the following line to your .vimrc and run :PluginInstall.
Plugin 'renyard/vim-git-flow-format'
Pathogen
Git clone the repo into your bundle directory:
git clone https://github.com/renyard/vim-git-flow-format.git ~/.vim/bundle/vim-git-flow-format
You can then configure vim-airline to use this format by adding the following line to your .vimrc:
let g:airline#extensions#branch#format = 'Git_flow_branch_format'
Customization
If you don't like the shortened prefixes provided by git-flow-format,
you can provide a dictionary of your own prefixes in the style of the default:
let g:git_flow_prefixes = {
\ 'master': '',
\ 'develop': '',
\ 'feature': 'F:',
\ 'release': 'R:',
\ 'hotfix': 'H:',
\ 'support': 'S:',
\ 'versiontag': 'V:'
\ }
Assigning an empty string, as in master and develop,
will result in no substitution being performed for matching branches.