command line utility that is able to translate any local git file to the web page of its remote.
Supported types of remotes are:
- Github
- Gitlab
- AWS CodeCommit
wget https://github.com/mhristof/gitbrowse/releases/latest/download/gitbrowse.$(uname) -O ~/bin/gitbrowse
chmod +x ~/bin/gitbrowse
$ git config --get remote.origin.url
[email protected]:mhristof/gitbrowse.git
$ gitbrowse Makefile
https://github.com/mhristof/gitbrowse/blob/master/Makefile
You can use gitbrowse
from you Vim with this snippet
function GitBrowse()
let line=line(".") + 1
exec "silent !open $(gitbrowse " . expand('%') . " --line " . line . ")"
exec ":redraw!"
endfunction
and if you want to abberviate it
cabbrev bb :call GitBrowse()<cr>