ghpr-blame.vim is a Vim plugin to investigate which line is modified by which pull request.
It's like git-blame
, but git-blame
shows which line is modified by which commit.
This Vim plugin was inspired by @kazuho's tiny script.
By running :GHPRBlame
, it extract necessary information from git-blame
command and creates a
list in a temporary window at left of current window.
The temporary window is automatically scrolled when you scroll the current window (see :help scrollbind
for the detail).
You can know which line is modified by which pull request by seeing the list.
When :GHPRBlame
, it automatically defines a buffer local mapping for inspecting the pull request
for the current line. If you want to know the details of the current line, please type <CR>
(it can
be customized by g:ghpr_show_pr_mapping
). It creates another temporary window and show the detail
of the pull request in it.
After your work has been done, please close the list window for pull requests or run :GHPRBlameQuit
explicitly. It cleans up the cache for fetching pull requests and git-blame
.
To fetch the details of pull request, this plugin uses GitHub PullRequest API. It may hit API rate limit when using this plugin heavily.
Please generate and set an API token by below steps.
- Visit https://github.com/settings/tokens in a browser
- Click 'Generate new token'
- Add token description
- Without checking any checkbox, click 'Generate token'
- Generated token is shown at the top of your tokens list
- Set it to
g:ghpr_github_auth_token
(Please be careful. The token is a credential)
You should also prepare the token to access. It should be different from the
github.com's one, so you can supply them by a dict form of
g:ghpr_github_auth_token
.
let g:ghpr_github_auth_token = {
\ 'github.com': '123456abcdef',
\ 'github.your-company.com': 'abcdef123456',
\ }
In addition, you should set the API url for GHE by g:ghpr_github_api_url
.
let g:ghpr_github_api_url = {
\ 'github.your-company.com': 'https://github.your-company.com/api/v3',
\ }
the MIT License
Copyright (c) 2017 rhysd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.