Ⅰ. 插件描述
Vim Pull Request review pluginⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'thejefe/vim-prreview'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'thejefe/vim-prreview'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'thejefe/vim-prreview'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/thejefe/vim-prreview
Ⅳ. 文档说明
# vim-prreview
This plugin allows you to review a list of github pull requests across the repositories and labels that you are interested in.
This plugin uses the Octokit gem, so you'll need to make sure you have that installed
gem install octokit
Configuration
set the repositories that you would like to see pull requests listed for by putting this in your vimrc file
let g:pr_review_github_repos = ['thejefe/vim-prreview','rails/rails']
set up custom pull request filters. For options see https://developer.github.com/v3/search/#search-issues
let g:pr_review_query = "state:open type:pr label:\"Needs QA\""
let g:pr_review_options = {'sort': 'updated', 'order': 'asc'}
Add a custom mere commmand, defaults to git pull --no-ff --no-edit
let g:pr_review_merge_command = 'git stash; git checkout rc; git reset --hard origin/rc; git pull; git pull --no-ff --no-edit origin'
For now, the github authentication credentials are coming from environment variables. You'll want to both of these set.
export GITHUB_TOKEN=123
export GITHUB_USERNAME=thejefe
Further enhancement!
To get the best experience, you should also install the TheJefe/github-issues.vim plugin. Until my changes are merged into the original at jaxbot/github-issues.vim, then you should be directed there.
Mappings
in the PR list window I have
omapped to open a PR in a browserqto:qthe split windowmto merge the selected PR<return>to open the PR in a new tab
From a PR view
<return>to open commit list of file change in a new tabsto open commit list of file change in a vertical splitqto:qthe window
Demo

Commits using TheJefe/github-issues.vim

File Diff using TheJefe/github-issues.vim

Run tests
rake test
or just
rake