3 ms·
If you mostly use GitHub and use tpope/vim-fugitive, you can already do this with https://github.com/tpope/vim-rhubarb https://github.com/tpope/vim-rhubarb, vis
by cormacrelf 6y ago
If you mostly use GitHub and use tpope/vim-fugitive, you can already do this with https://github.com/tpope/vim-rhubarb https://github.com/tpope/vim-rhubarb, visual select, :GBrowse.
- swalladge 6y agoFugitive + rhurbarb is great! I also use https://github.com/shumphrey/fugitive-gitlab.vim https://github.com/shumphrey/fugitive-gitlab.vim which extends :Gbrowse for gitlab repositories.
- pacomerh 6y agoYup this is what I use too. :10,15.Gbrowse will open the current file selected from line 10 to 15
- boring_twenties 6y agoFugitive supports basically every git web frontend including GitLab, SourceHut, and a bunch of others (via plugins).
- codecurve 6y agoAs I discovered yesterday, :Gbrowse also works for other contexts such as jumping directly to the GitHub page for a specific commit after opening one via :Git log or :Git blame.
- riffraff 6y agoif, like me, you've thought "wait, but :GBrowse only opens the file", the trick is to _select_ a line first, i.e. > :{range}GBrowse [args]
- jdonaldson 6y agoYeah, I'm sure that other plugin is great and all, but once Tim Pope puts his name on something, it becomes an instant default for me.