A simple neovim plugin to open GitLab or GitHub and browse the current file.
It is basically like :Gbrowse
and :Gblame
from vim-fugitive + vim-rhubarb, but tailored to my specific use-case: sharing links to repos, files, and blames. Which means it is a bit smarter in edge-cases.
- Browse & blame even if the current branch is not pushed to origin
- Browse a directory
- Generate GitLab links
- Works with GitLab orgs/projects/namespaces
Using Packer:
use { "Morozzzko/git_browse.nvim" }
:Blame
– open blame:BlameLine
– open blame for file navigated to cursor's line:BlameSelected
– open blame for selected lines, works only in visual mode:Browse
– open tree for directory / blob for file:BrowseLine
– open tree for directory / blob for file navigated to cursor's line:BrowseSelected
– open blof for file with selected lines, works only in visual mode
There are a few things which are not implemented because I didn't have the specific need for it:
- Support for any OS besides macOS
- Support for complex origin names
- Thorough testing with custom GitLab setups
- Blame to specific line
PRs are welcome, though. Feel free to send one! I'll gladly accept it as long as it has a reasonable amount of tests and keeps backwards compatibility