mirror of
https://github.com/harivansh-afk/forge.nvim.git
synced 2026-04-15 09:01:15 +00:00
ci: format
This commit is contained in:
parent
0c41ff01fb
commit
c0d2a19498
1 changed files with 105 additions and 107 deletions
212
README.md
212
README.md
|
|
@ -18,7 +18,8 @@ your editor.
|
||||||
unified/split toggle and quickfix navigation
|
unified/split toggle and quickfix navigation
|
||||||
- Commit and branch browsing with checkout, diff, and URL generation
|
- Commit and branch browsing with checkout, diff, and URL generation
|
||||||
- File/line permalink generation and yanking (commit and branch URLs)
|
- File/line permalink generation and yanking (commit and branch URLs)
|
||||||
- [fzf-lua](https://github.com/ibhagwan/fzf-lua) pickers with contextual keybinds
|
- [fzf-lua](https://github.com/ibhagwan/fzf-lua) pickers with contextual
|
||||||
|
keybinds
|
||||||
- Pluggable source registration for custom or self-hosted forges
|
- Pluggable source registration for custom or self-hosted forges
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
@ -69,8 +70,8 @@ git clone https://github.com/barrettruth/forge.nvim \
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
forge.nvim works through two entry points: the `:Forge` command and the
|
forge.nvim works through two entry points: the `:Forge` command and the `<c-g>`
|
||||||
`<c-g>` picker.
|
picker.
|
||||||
|
|
||||||
`:Forge` with no arguments (or `<c-g>`) opens the top-level picker — PRs,
|
`:Forge` with no arguments (or `<c-g>`) opens the top-level picker — PRs,
|
||||||
issues, CI, commits, branches, worktrees, and browse actions. Each sub-picker
|
issues, CI, commits, branches, worktrees, and browse actions. Each sub-picker
|
||||||
|
|
@ -163,107 +164,107 @@ vim.g.forge = {
|
||||||
|
|
||||||
`:Forge` with no arguments opens the top-level picker. Subcommands:
|
`:Forge` with no arguments opens the top-level picker. Subcommands:
|
||||||
|
|
||||||
| Command | Description |
|
| Command | Description |
|
||||||
|---|---|
|
| --------------------------------------------- | --------------------------------- |
|
||||||
| `:Forge pr` | List open PRs |
|
| `:Forge pr` | List open PRs |
|
||||||
| `:Forge pr --state={open,closed,all}` | List PRs by state |
|
| `:Forge pr --state={open,closed,all}` | List PRs by state |
|
||||||
| `:Forge pr create [--draft] [--fill] [--web]` | Create PR |
|
| `:Forge pr create [--draft] [--fill] [--web]` | Create PR |
|
||||||
| `:Forge pr checkout {num}` | Checkout PR branch |
|
| `:Forge pr checkout {num}` | Checkout PR branch |
|
||||||
| `:Forge pr diff {num}` | Review PR diff |
|
| `:Forge pr diff {num}` | Review PR diff |
|
||||||
| `:Forge pr worktree {num}` | Fetch PR into worktree |
|
| `:Forge pr worktree {num}` | Fetch PR into worktree |
|
||||||
| `:Forge pr checks {num}` | Show PR checks |
|
| `:Forge pr checks {num}` | Show PR checks |
|
||||||
| `:Forge pr browse {num}` | Open PR in browser |
|
| `:Forge pr browse {num}` | Open PR in browser |
|
||||||
| `:Forge pr manage {num}` | Merge/approve/close/draft actions |
|
| `:Forge pr manage {num}` | Merge/approve/close/draft actions |
|
||||||
| `:Forge issue` | List all issues |
|
| `:Forge issue` | List all issues |
|
||||||
| `:Forge issue --state={open,closed,all}` | List issues by state |
|
| `:Forge issue --state={open,closed,all}` | List issues by state |
|
||||||
| `:Forge issue browse {num}` | Open issue in browser |
|
| `:Forge issue browse {num}` | Open issue in browser |
|
||||||
| `:Forge issue close {num}` | Close issue |
|
| `:Forge issue close {num}` | Close issue |
|
||||||
| `:Forge issue reopen {num}` | Reopen issue |
|
| `:Forge issue reopen {num}` | Reopen issue |
|
||||||
| `:Forge ci` | CI runs for current branch |
|
| `:Forge ci` | CI runs for current branch |
|
||||||
| `:Forge ci --all` | CI runs for all branches |
|
| `:Forge ci --all` | CI runs for all branches |
|
||||||
| `:Forge commit` | Browse commits |
|
| `:Forge commit` | Browse commits |
|
||||||
| `:Forge commit checkout {sha}` | Checkout commit |
|
| `:Forge commit checkout {sha}` | Checkout commit |
|
||||||
| `:Forge commit diff {sha}` | Review commit diff |
|
| `:Forge commit diff {sha}` | Review commit diff |
|
||||||
| `:Forge commit browse {sha}` | Open commit in browser |
|
| `:Forge commit browse {sha}` | Open commit in browser |
|
||||||
| `:Forge branch` | Browse branches |
|
| `:Forge branch` | Browse branches |
|
||||||
| `:Forge branch diff {name}` | Review branch diff |
|
| `:Forge branch diff {name}` | Review branch diff |
|
||||||
| `:Forge branch browse {name}` | Open branch in browser |
|
| `:Forge branch browse {name}` | Open branch in browser |
|
||||||
| `:Forge worktree` | List worktrees |
|
| `:Forge worktree` | List worktrees |
|
||||||
| `:Forge browse [--root] [--commit]` | Open file/repo/commit in browser |
|
| `:Forge browse [--root] [--commit]` | Open file/repo/commit in browser |
|
||||||
| `:Forge yank [--commit]` | Yank permalink for file/line |
|
| `:Forge yank [--commit]` | Yank permalink for file/line |
|
||||||
| `:Forge review end` | End review session |
|
| `:Forge review end` | End review session |
|
||||||
| `:Forge review toggle` | Toggle split/unified review |
|
| `:Forge review toggle` | Toggle split/unified review |
|
||||||
| `:Forge cache clear` | Clear all caches |
|
| `:Forge cache clear` | Clear all caches |
|
||||||
|
|
||||||
## Keymaps
|
## Keymaps
|
||||||
|
|
||||||
### Global
|
### Global
|
||||||
|
|
||||||
| Key | Mode | Description |
|
| Key | Mode | Description |
|
||||||
|---|---|---|
|
| ----------- | ---- | -------------------------------- |
|
||||||
| `<c-g>` | n, v | Open forge picker |
|
| `<c-g>` | n, v | Open forge picker |
|
||||||
| `]q` / `[q` | n | Next/prev quickfix entry (wraps) |
|
| `]q` / `[q` | n | Next/prev quickfix entry (wraps) |
|
||||||
| `]l` / `[l` | n | Next/prev loclist entry (wraps) |
|
| `]l` / `[l` | n | Next/prev loclist entry (wraps) |
|
||||||
|
|
||||||
### Fugitive buffer
|
### Fugitive buffer
|
||||||
|
|
||||||
Active in `fugitive` filetype buffers when a forge is detected.
|
Active in `fugitive` filetype buffers when a forge is detected.
|
||||||
|
|
||||||
| Key | Description |
|
| Key | Description |
|
||||||
|---|---|
|
| ----- | ----------------------------------- |
|
||||||
| `cpr` | Create PR (compose buffer) |
|
| `cpr` | Create PR (compose buffer) |
|
||||||
| `cpd` | Create draft PR |
|
| `cpd` | Create draft PR |
|
||||||
| `cpf` | Create PR from commits (no compose) |
|
| `cpf` | Create PR from commits (no compose) |
|
||||||
| `cpw` | Push and open web creation |
|
| `cpw` | Push and open web creation |
|
||||||
|
|
||||||
### Review
|
### Review
|
||||||
|
|
||||||
Active during a review session.
|
Active during a review session.
|
||||||
|
|
||||||
| Key | Description |
|
| Key | Description |
|
||||||
|---|---|
|
| --- | ------------------------- |
|
||||||
| `s` | Toggle unified/split diff |
|
| `s` | Toggle unified/split diff |
|
||||||
|
|
||||||
### Terminal (log buffers)
|
### Terminal (log buffers)
|
||||||
|
|
||||||
Active on CI/check log terminals when a URL is available.
|
Active on CI/check log terminals when a URL is available.
|
||||||
|
|
||||||
| Key | Description |
|
| Key | Description |
|
||||||
|---|---|
|
| ---- | ------------------------- |
|
||||||
| `gx` | Open run/check in browser |
|
| `gx` | Open run/check in browser |
|
||||||
|
|
||||||
## Picker Actions
|
## Picker Actions
|
||||||
|
|
||||||
Keybinds shown in the fzf header. `default` = `enter`.
|
Keybinds shown in the fzf header. `default` = `enter`.
|
||||||
|
|
||||||
| Picker | Key | Action |
|
| Picker | Key | Action |
|
||||||
|---|---|---|
|
| ------------ | ------------------------------ | ---------------------------------- |
|
||||||
| **PR** | `enter` | Checkout |
|
| **PR** | `enter` | Checkout |
|
||||||
| | `ctrl-d` | Review diff |
|
| | `ctrl-d` | Review diff |
|
||||||
| | `ctrl-w` | Worktree |
|
| | `ctrl-w` | Worktree |
|
||||||
| | `ctrl-t` | Checks |
|
| | `ctrl-t` | Checks |
|
||||||
| | `ctrl-x` | Browse |
|
| | `ctrl-x` | Browse |
|
||||||
| | `ctrl-e` | Manage (merge/approve/close/draft) |
|
| | `ctrl-e` | Manage (merge/approve/close/draft) |
|
||||||
| | `ctrl-a` | Create new |
|
| | `ctrl-a` | Create new |
|
||||||
| | `ctrl-o` | Cycle state (open/closed/all) |
|
| | `ctrl-o` | Cycle state (open/closed/all) |
|
||||||
| | `ctrl-r` | Refresh |
|
| | `ctrl-r` | Refresh |
|
||||||
| **Issue** | `enter` | Browse |
|
| **Issue** | `enter` | Browse |
|
||||||
| | `ctrl-s` | Close/reopen |
|
| | `ctrl-s` | Close/reopen |
|
||||||
| | `ctrl-o` | Cycle state |
|
| | `ctrl-o` | Cycle state |
|
||||||
| | `ctrl-r` | Refresh |
|
| | `ctrl-r` | Refresh |
|
||||||
| **Checks** | `enter` | View log (tails if running) |
|
| **Checks** | `enter` | View log (tails if running) |
|
||||||
| | `ctrl-x` | Browse |
|
| | `ctrl-x` | Browse |
|
||||||
| | `ctrl-f` / `ctrl-p` / `ctrl-n` | Filter: failed / passed / running |
|
| | `ctrl-f` / `ctrl-p` / `ctrl-n` | Filter: failed / passed / running |
|
||||||
| | `ctrl-a` | Show all |
|
| | `ctrl-a` | Show all |
|
||||||
| **CI** | `enter` | View log (tails if running) |
|
| **CI** | `enter` | View log (tails if running) |
|
||||||
| | `ctrl-x` | Browse |
|
| | `ctrl-x` | Browse |
|
||||||
| | `ctrl-r` | Refresh |
|
| | `ctrl-r` | Refresh |
|
||||||
| **Commits** | `enter` | Checkout (detached) |
|
| **Commits** | `enter` | Checkout (detached) |
|
||||||
| | `ctrl-d` | Review diff |
|
| | `ctrl-d` | Review diff |
|
||||||
| | `ctrl-x` | Browse |
|
| | `ctrl-x` | Browse |
|
||||||
| | `ctrl-y` | Yank hash |
|
| | `ctrl-y` | Yank hash |
|
||||||
| **Branches** | `ctrl-d` | Review diff |
|
| **Branches** | `ctrl-d` | Review diff |
|
||||||
| | `ctrl-x` | Browse |
|
| | `ctrl-x` | Browse |
|
||||||
|
|
||||||
## Custom Sources
|
## Custom Sources
|
||||||
|
|
||||||
|
|
@ -282,18 +283,18 @@ vim.g.forge = {
|
||||||
```
|
```
|
||||||
|
|
||||||
A source is a table implementing the `forge.Forge` interface. Required fields:
|
A source is a table implementing the `forge.Forge` interface. Required fields:
|
||||||
`name` (string), `cli` (string, checked via `executable()`), `kinds` (`{ issue,
|
`name` (string), `cli` (string, checked via `executable()`), `kinds`
|
||||||
pr }`), and `labels` (`{ issue, pr, pr_one, pr_full, ci }`).
|
(`{ issue, pr }`), and `labels` (`{ issue, pr, pr_one, pr_full, ci }`).
|
||||||
|
|
||||||
Required methods (all receive `self`): `list_pr_json_cmd`, `list_issue_json_cmd`,
|
Required methods (all receive `self`): `list_pr_json_cmd`,
|
||||||
`pr_json_fields`, `issue_json_fields`, `view_web`, `browse`, `browse_root`,
|
`list_issue_json_cmd`, `pr_json_fields`, `issue_json_fields`, `view_web`,
|
||||||
`browse_branch`, `browse_commit`, `checkout_cmd`, `yank_branch`, `yank_commit`,
|
`browse`, `browse_root`, `browse_branch`, `browse_commit`, `checkout_cmd`,
|
||||||
`fetch_pr`, `pr_base_cmd`, `pr_for_branch_cmd`, `checks_cmd`, `check_log_cmd`,
|
`yank_branch`, `yank_commit`, `fetch_pr`, `pr_base_cmd`, `pr_for_branch_cmd`,
|
||||||
`check_tail_cmd`, `list_runs_json_cmd`, `list_runs_cmd`, `normalize_run`,
|
`checks_cmd`, `check_log_cmd`, `check_tail_cmd`, `list_runs_json_cmd`,
|
||||||
`run_log_cmd`, `run_tail_cmd`, `merge_cmd`, `approve_cmd`, `repo_info`,
|
`list_runs_cmd`, `normalize_run`, `run_log_cmd`, `run_tail_cmd`, `merge_cmd`,
|
||||||
`pr_state`, `close_cmd`, `reopen_cmd`, `close_issue_cmd`, `reopen_issue_cmd`,
|
`approve_cmd`, `repo_info`, `pr_state`, `close_cmd`, `reopen_cmd`,
|
||||||
`draft_toggle_cmd`, `create_pr_cmd`, `create_pr_web_cmd`, `default_branch_cmd`,
|
`close_issue_cmd`, `reopen_issue_cmd`, `draft_toggle_cmd`, `create_pr_cmd`,
|
||||||
`template_paths`.
|
`create_pr_web_cmd`, `default_branch_cmd`, `template_paths`.
|
||||||
|
|
||||||
See `lua/forge/github.lua`, `lua/forge/gitlab.lua`, or `lua/forge/codeberg.lua`
|
See `lua/forge/github.lua`, `lua/forge/gitlab.lua`, or `lua/forge/codeberg.lua`
|
||||||
for complete implementations. The `forge.Forge` class definition with full type
|
for complete implementations. The `forge.Forge` class definition with full type
|
||||||
|
|
@ -328,29 +329,26 @@ Run `:checkhealth forge` to verify your setup. Checks for `git`, forge CLIs
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
**Q: How do I create a PR?**
|
**Q: How do I create a PR?** `<c-g>` -> Pull Requests -> `ctrl-a` to compose. Or
|
||||||
`<c-g>` -> Pull Requests -> `ctrl-a` to compose. Or from fugitive: `cpr`
|
from fugitive: `cpr` (compose), `cpd` (draft), `cpf` (instant), `cpw` (web).
|
||||||
(compose), `cpd` (draft), `cpf` (instant), `cpw` (web).
|
|
||||||
|
|
||||||
**Q: Does review mode require diffs.nvim?**
|
**Q: Does review mode require diffs.nvim?** Yes. Without
|
||||||
Yes. Without [diffs.nvim](https://github.com/barrettruth/diffs.nvim), the diff
|
[diffs.nvim](https://github.com/barrettruth/diffs.nvim), the diff action and
|
||||||
action and review toggling are unavailable.
|
review toggling are unavailable.
|
||||||
|
|
||||||
**Q: How does forge detection work?**
|
**Q: How does forge detection work?** forge.nvim reads the `origin` remote URL
|
||||||
forge.nvim reads the `origin` remote URL and matches against known hosts and
|
and matches against known hosts and any custom `sources.<name>.hosts`. The first
|
||||||
any custom `sources.<name>.hosts`. The first match wins, and the CLI must be in
|
match wins, and the CLI must be in `$PATH`.
|
||||||
`$PATH`.
|
|
||||||
|
|
||||||
**Q: Can I use this with self-hosted GitLab/Gitea?**
|
**Q: Can I use this with self-hosted GitLab/Gitea?** Yes. Add your host to
|
||||||
Yes. Add your host to `vim.g.forge.sources`. See the [examples](#examples).
|
`vim.g.forge.sources`. See the [examples](#examples).
|
||||||
|
|
||||||
**Q: What does `ctrl-o` do in pickers?**
|
**Q: What does `ctrl-o` do in pickers?** Cycles the state filter: open -> closed
|
||||||
Cycles the state filter: open -> closed -> all -> open.
|
-> all -> open.
|
||||||
|
|
||||||
**Q: How do I merge/approve/close a PR?**
|
**Q: How do I merge/approve/close a PR?** `ctrl-e` on a PR in the picker opens
|
||||||
`ctrl-e` on a PR in the picker opens the manage picker. Available actions depend
|
the manage picker. Available actions depend on your repository permissions.
|
||||||
on your repository permissions.
|
|
||||||
|
|
||||||
**Q: Does this work without a forge remote?**
|
**Q: Does this work without a forge remote?** Partially. Commits, branches, and
|
||||||
Partially. Commits, branches, and worktrees work in any git repo. PRs, issues,
|
worktrees work in any git repo. PRs, issues, CI, and browse require a detected
|
||||||
CI, and browse require a detected forge.
|
forge.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue