Morozzzko / git_browse.nvim

Neovim plugin to open GitHub/GitLab with blame or file details

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git_browse.nvim

GitHub Workflow Status Lua

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.

Features

  • Browse & blame even if the current branch is not pushed to origin
  • Browse a directory
  • Generate GitLab links
  • Works with GitLab orgs/projects/namespaces

Install

Using Packer:

use { "Morozzzko/git_browse.nvim" }

Commands

  • :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

Things to do

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

About

Neovim plugin to open GitHub/GitLab with blame or file details

License:MIT License


Languages

Language:Lua 98.7%Language:Makefile 1.3%