Problem: picker backend names were hard-coded as string literals in `picker/init.lua`, `health.lua`, and `init.lua` validation, making them easy to get out of sync. Solution: export `backends` and `detect_order` from `forge.picker` and reference them in health check and config validation instead of duplicating the name strings. |
||
|---|---|---|
| .github | ||
| doc | ||
| lua/forge | ||
| plugin | ||
| scripts | ||
| spec | ||
| .busted | ||
| .editorconfig | ||
| .gitignore | ||
| .luarc.json | ||
| .pre-commit-config.yaml | ||
| .prettierignore | ||
| .prettierrc | ||
| flake.lock | ||
| flake.nix | ||
| forge.nvim-scm-1.rockspec | ||
| LICENSE | ||
| README.md | ||
| selene.toml | ||
| stylua.toml | ||
| vim.yaml | ||
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
- Neovim 0.10.0+
- fzf-lua
- At least one forge CLI:
gh,glab, ortea - (Optional) diffs.nvim for review mode
- (Optional) vim-fugitive for split diff and fugitive keymaps
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.