Note
This plugin is pretty sweet, but still WIP/beta. PRs/feedback welcome!
Work with GitHub PRs in Neovim. Wraps the GitHub gh CLI with a minimalist yet
effective workflow.
Guh is ~2k lines of code, leveraging builtin Nvim mechanisms such as diagnostics
and 'scrollbind' buffers, and otherwise delegating to the gh CLI.
Run :Guh to see status.
:Guh
Run :Guh 42 to view PR/issue 42. Also accepts a GitHub URL, owner/repo#123
slug, or commit-id (SHA):
:Guh 35951
:Guh a1b2c3d
:Guh https://github.com/neovim/neovim/pull/35951
:Guh neovim/neovim#35951
:Guh guh://neovim/neovim/pr/35951
:Guh https://github.com/neovim/neovim/commit/a1b2c3d
Inside any guh:// buffer, press <CR> to run :Guh on the target at cursor.
Editable buffers (comments, merge message) confirm the action on write-and-close:
:wq(orZZ) submits.:q!(orZQ) discards.
See help file for details.
vim.pack.add{ 'https://github.com/justinmk/guh.nvim' }See help for default config.
Requirements:
- nvim 0.13+
- "gh" (GitHub CLI)
- For working with Git, use any Git plugin such as vim-fugitive.
- For highlighting diffs, use a plugin such as diffs.nvim.
- Shows
ghoutput in a:terminalbuffer. - Sets global
<Plug>(guh-…)keymaps. Provides default buffer-local mappings if you don't set any mappings to the<Plug>mappings. :Guhis the main entrypoint. It shows status, or views a given item (PR, issue).- Presents PR diff comments:
- in a 'scrollbind' split window
- as "diagnostics" (
vim.diagnostic), loaded in quickfix
- Loads most-recent CI logs for all "jobs" in the CI matrix.
- (TODO) Fetch the git data into
.git(without doing a checkout). - (TODO) When viewing the diff, user can navigate to the git object (file) without doing a checkout.
- (TODO) PR comments will display on relevant local git objects.
Run the tests:
NEOVIM_PATH='/path/to/neovim/' make test
Run specific tests:
NEOVIM_PATH='/path/to/neovim/' make test TEST_FILTER=load_comments
guh.nvim was originally forked (and completely rewritten) from https://github.com/daliusd/ghlite.nvim by Dalius Dobravolskas.