Keith Smiley 57a350e632 Strip trailing slashes from URLs
Previously if you had a remote in the format:

https://github.com/owner/repo/

When using Gbrowse from fugitive, there would be double slashes in the
opened URL:

https://github.com/owner/repo//blob/master/README.md

This caused GitHub not to show a preview of the lines inline if you
posted it in a comment. This change strips the trailing slash if it
exists.
2019-03-20 15:54:37 -04:00
2019-03-20 15:54:37 -04:00
2018-06-02 18:12:52 -04:00
2011-08-27 13:05:15 -04:00

rhubarb.vim

If fugitive.vim is the Git, rhubarb.vim is the Hub. Here's the full list of features:

  • Enables :Gbrowse from fugitive.vim to open GitHub URLs.

  • Sets up :Git to use hub if installed rather than git.

  • In commit messages, GitHub issues, issue URLs, and collaborators can be omni-completed (<C-X><C-O>, see :help compl-omni). This makes inserting those Closes #123 remarks slightly easier than copying and pasting from the browser.

Installation

If you don't have a preferred installation method, I recommend installing pathogen.vim, and then simply copy and paste:

cd ~/.vim/bundle
git clone https://github.com/tpope/vim-rhubarb.git
vim -u NONE -c "helptags vim-rhubarb/doc" -c q

You'll also need fugitive.vim.

Curl (included with macOS) is required for features that use the GitHub API (i.e., :Gbrowse doesn't need it). Generate a personal access token with repo permissions and add it to your .netrc:

echo 'machine api.github.com login <user> password <token>' >> ~/.netrc

If you are using GitHub Enterprise, repeat this step for each domain (omit the api. portion). You'll also need to tell Rhubarb the root URLs:

let g:github_enterprise_urls = ['https://example.com']

FAQ

How do I turn off that preview window that shows the issue body?

set completeopt-=preview

Self-Promotion

Like rhubarb.vim? Follow the repository on GitHub. And if you're feeling especially charitable, follow tpope on Twitter and GitHub.

License

Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. See :help license.

Description
rhubarb.vim: GitHub extension for fugitive.vim
Readme MIT 154 KiB
Languages
Vim Script 100%