fugitive.vimプラグインには、:help fugitive-:Gbrowse
必要な処理を実行する機能があります。それは一般的にも素晴らしいです。
*fugitive-:Gbrowse*
:[range]Gbrowse If the remote for the current branch is on GitHub,
open the current file, blob, tree, commit, or tag
(with git-web--browse) on GitHub. Otherwise, open the
current file, blob, tree, commit, or tag in
git-instaweb (if you have issues, verify you can run
"git instaweb" from a terminal). If a range is given,
it is appropriately appended to the URL as an anchor.
To use with GitHub FI, point g:fugitive_github_domains
at a list of domains:
let g:fugitive_github_domains = ['git.example.com']
:[range]Gbrowse! Like :Gbrowse, but put the URL on the clipboard rather
than opening it.