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.