Ⅰ. 插件描述
A vim plugin to extract a JIRA ticket number from a branch name so that it can be prepended to a commit messageⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mshirlaw/jira-prepend'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mshirlaw/jira-prepend'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mshirlaw/jira-prepend'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/mshirlaw/jira-prepend
Ⅳ. 文档说明
JIRA Prepend
JIRA Prepend provides a vim mapping for extracting the JIRA ticket number
from a git branch name for the purposes of prepending it to the start
of a commit message.
For example if you use JIRA and label all branches and
commit messages with the name of the JIRA ticket that you are working on
then JIRA Prepend makes it easy to extract the ticket number from the branch name
and prepend it automatically when committing.
Usage
JIRA Prepend provides a mapping to extract and paste a JIRA ticket number
of the form ABCD-1234 from a git branch name and automatically paste it at the
front of commit message.
The default mapping is <leader>pp.
In normal mode this command will search for the pattern defined in g:jira_prepend_ticket_pattern which must be set in the user's .vimrc file.
Options
To set the JIRA ticket search pattern to the string ABCD you may use following in
your .vimrc. For example:
let g:jira_prepend_ticket_pattern="ABCD"To set an additional (optional) custom commit message i.e. "Bugfix " at the start of each commit
message after the ticket number you can set g:jira_prepend_custom_message in your .vimrc. For example:
let g:jira_prepend_custom_message="Bugfix "Installation
If you don't have a preferred installation method, I recommend
using Vundle. Assuming you
have Vundle installed and configured, the following steps will install the plugin:
Add the following line to your ~/.vimrc and then run :PluginInstall from within Vim:
call vundle#begin()
" ...
Plugin 'mshirlaw/jira-prepend'
" ...
call vundle#end()