Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ categories = ["command-line-utilities", "development-tools"]
ratatui = { version = "0.30", features = ["unstable-rendered-line-info"] }
crossterm = "0.29"

# Vim-style modal editing engine for the review comment box (opt-in via
# `comment_vim`). Used as the editing model + input engine only; we keep our
# own rendering, so its widget/clipboard/syntax features are disabled.
edtui = { version = "0.11", default-features = false }

# Git operations
git2 = { version = "0.20", default-features = false }

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ ignore_whitespace = false # ignore all whitespace in local VCS diffs
appearance = "system" # or "dark" / "light"
mouse = true
leader = ";" # configurable prefix for leader shortcuts
comment_vim = false # vim modal editing in the review comment box
review_watch_interval_ms = 1000 # set to 0 to disable persisted-review polling

[[comment_types]]
Expand Down
4 changes: 4 additions & 0 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ ignore_whitespace = false
show_file_list = true
mouse = true
leader = ","
comment_vim = false
comment_tab_width = 4
wrap = false
cursor_line = true
transparent_background = true
Expand Down Expand Up @@ -63,6 +65,8 @@ comment_type_prefix = true
| `show_file_list` | `true` | Whether the file list panel is visible on startup. Toggle with `<leader>e`. |
| `mouse` | `true` | Wheel scrolling, clicks, and drag-to-select. |
| `leader` | `;` | Single-character prefix for panel focus, sidebar toggles, and review-comment shortcuts. Invalid multi-character values are ignored with a startup warning. |
| `comment_vim` | `false` | Vim modal editing in the comment box; toggle at runtime with `:vim`. When off, default emacs/readline bindings. |
| `comment_tab_width` | `4` | Spaces inserted by Tab while typing in the vim comment box (Insert mode). |
| `wrap` | `false` | Line wrap in the diff view. Toggle with `:set wrap!`. |
| `cursor_line` | `true` | Highlight the current cursor line and visual selection. |
| `transparent_background` | `true` | Let the terminal background show through panels. `false` paints the theme's `panel_bg`. |
Expand Down
13 changes: 12 additions & 1 deletion docs/KEYBINDINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ Shown below the file tree when local comments or visible remote PR threads exist
| `<leader>c` | Add review comment |
| `v` / `V` | Enter visual mode for range comments |
| `dd` | Delete comment at cursor |
| `i` | Edit comment at cursor |
| `i` | Edit comment at cursor (vim: text cursor at start) |
| `A` | Edit comment at cursor with text cursor at end (vim mode only) |
| `y` | Copy review to clipboard |

## Visual mode
Expand All @@ -91,6 +92,15 @@ Shown below the file tree when local comments or visible remote PR threads exist
| `Ctrl-u` | Clear line |
| `Esc` / `Ctrl-c` | Cancel |

With `comment_vim = true` the box uses [`edtui`](https://github.com/preiter93/edtui)
modal editing (Normal/Insert/Visual: `hjkl`, `w`/`b`/`e`, `dd`/`D`/`ciw`/`x`,
`u`/`Ctrl-r`, visual `v`+`y`/`d`/`p`). From Normal mode `:w` (or `Enter` twice)
saves and `:q` (or `Esc`/`q` twice) cancels — the first press arms the action
and the header shows a confirm hint. `Tab` cycles the comment type in Normal
mode and inserts `comment_tab_width` spaces (default 4) in Insert mode; `Ctrl-s`
also saves. Operator+motion combos like
`dw`/`cw` aren't supported (edtui limitation).

## Commands

In command mode,
Expand All @@ -105,6 +115,7 @@ In command mode,
| `:edit` | Open focused file in `$EDITOR` |
| `:clip` (`:export`) | Copy review to clipboard |
| `:diff` | Toggle diff view (unified / side-by-side) |
| `:vim` / `:novim` (`:set vim` / `:set novim`) | Enable/toggle/disable vim modal editing in the comment box (overrides `comment_vim`) |
| `:commits` | Select commits to review |
| `:submit` | Open submit picker (Comment / Approve / Request changes / Draft) |
| `:submit comment` | Submit a Comment review |
Expand Down
Loading
Loading