Complete GitHub PR review workflow directly in Vim - Read, reply, and resolve PR comments without leaving your editor.
- Fetches all inline review comments from GitHub PRs
- Displays in Vim's quickfix list for easy navigation
- Jump directly to exact file and line locations
- Shows comment author and full text
- Automatically detects resolved/unresolved status
- Reply to comments - Respond directly from Vim (
r
key) - Resolve threads - Mark conversations as resolved (
R
key) - Unresolve threads - Reopen resolved conversations (
U
key) - Full GitHub PR review workflow without context switching
- Smart caching for instant reopening
- Separate commands for cached vs fresh data
- Batch GraphQL queries for efficiency
- Hide resolved comments by default
- Configurable comment truncation
- Line wrapping options
- Detailed preview mode
- Vim 8.0+ or Neovim
gh
CLI tool installed and authenticated- Git repository with a GitHub remote
Plugin 'ashot/vim-pr-comments'
Plug 'ashot/vim-pr-comments'
cd ~/.vim/bundle
git clone https://github.com/ashot/vim-pr-comments
- Navigate to any file in a Git repo with an open PR
- Run
:PRCommentsOpen
to load comments - Use quickfix window to navigate and interact:
Enter
- Jump to comment locationSpace
- View full comment detailsr
- Reply to commentR
- Resolve comment threadU
- Unresolve comment thread
Add to your .vimrc
:
" Maximum comment length in quickfix (default: 300 chars)
let g:pr_comments_max_length = 500
" Show full comments without truncation (default: 0)
let g:pr_comments_show_full = 1
" Enable line wrapping in quickfix window (default: 0)
let g:pr_comments_wrap_quickfix = 1
" Show resolved comments by default (default: 0 - hidden)
let g:pr_comments_show_resolved = 0
:PRCommentsOpen
- Open comments (uses cache if available):PRCommentsReload
- Force refresh from GitHub:PRCommentsAll
- Show all comments including resolved
:PRCommentsDebug
- Show debug information:PRCommentDetail
- Show full comment in preview:PRCommentReply
- Reply to selected comment:PRCommentResolve
- Resolve selected thread:PRCommentUnresolve
- Unresolve selected thread
<leader>prc
- Open PR comments (cached)<leader>prr
- Reload PR comments (fresh)<leader>pra
- Show all including resolved]c
/[c
- Next/previous comment]C
/[C
- Last/first comment
<CR>
- Jump to location and close quickfixo
- Jump to location (keep quickfix open)<Space>
- Show full comment detailsr
- Reply to commentR
- Resolve comment threadU
- Unresolve comment thread
:PRCommentsOpen " Load PR comments
" Navigate with j/k in quickfix
<Space> " Read full comment
r " Type reply and hit enter
R " Mark thread as resolved
:PRCommentsReload " Refresh after new comments
:PRCommentsAll " Show resolved comments too
- Detects current Git branch and finds associated PR
- Fetches comments via GitHub REST API
- Queries GraphQL for resolution status
- Populates quickfix with smart line number detection
- Uses GraphQL mutations for resolve/unresolve
- Posts replies to the correct review thread
- Resolved comments hidden by default - Keeps focus on active discussions
- View resolved with
:PRCommentsAll
- Resolution state from GitHub - Not based on comment text
- Proper thread management - Resolves entire conversation thread
- Comments are cached per session for fast access
- Use
:PRCommentsReload
after new comments are added - Press
<Space>
in quickfix for full comment with code context - The plugin shows comment count and resolution status
- Line numbers auto-adjust for file changes since review
Ensure your branch has an open PR on GitHub
Check gh
CLI authentication:
gh auth status
gh pr view # Should show your PR
You need write access to the repository to resolve comments
Comments use line numbers from when they were created. If files changed significantly, positions may be approximate.
Issues and PRs welcome at github.com/ashot/vim-pr-comments
MIT