forge.nvim/README.md
2026-03-28 15:18:01 -04:00

2.5 KiB

forge.nvim

Forge-agnostic git workflow for Neovim

PR, issue, and CI workflows across GitHub, GitLab, and Codeberg/Gitea/Forgejo — without leaving your editor.

Features

  • Automatic forge detection from git remote (gh, glab, tea)
  • PR lifecycle: list, create (compose buffer with template discovery, diff stat, reviewers), checkout, worktree, review diff, merge, approve, close/reopen, draft toggle
  • Issue management: list, browse, close/reopen, state filtering
  • CI/CD: view runs per-branch or repo-wide, stream logs, filter by status
  • Code review via diffs.nvim with unified/split toggle and quickfix navigation
  • Commit and branch browsing with checkout, diff, and URL generation
  • File/line permalink generation and yanking
  • fzf-lua pickers with contextual keybinds
  • Pluggable source registration for custom or self-hosted forges

Requirements

Installation

Install with your package manager of choice or via luarocks:

luarocks install forge.nvim

Documentation

:help forge.nvim

FAQ

Q: How do I configure forge.nvim?

Configure via vim.g.forge before the plugin loads. All fields are optional:

vim.g.forge = {
  sources = { gitlab = { hosts = { 'gitlab.mycompany.com' } } },
  display = { icons = { open = '', merged = '', closed = '' } },
}

Q: How do I install with lazy.nvim?

{
  'barrettruth/forge.nvim',
  dependencies = { 'ibhagwan/fzf-lua' },
}

Q: How do I create a PR?

<c-g> to open the picker, select Pull Requests, then ctrl-a to compose. Or from a fugitive buffer: cpr (compose), cpd (draft), cpf (instant from commits), cpw (push and open web).

Q: Does review mode require diffs.nvim?

Yes. Without diffs.nvim, diff actions and review toggling are unavailable.

Q: How does forge detection work?

forge.nvim reads the origin remote URL and matches against known hosts and any custom sources.<name>.hosts entries. The first match wins, and the CLI must be in $PATH.