Skip to content

KEY60228/reviewthem.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ReviewThem Logo

ReviewThem.nvim

A Neovim plugin for streamlining code reviews directly in your editor.

This project is inspired by ReviewIt - a fantastic code review tool. We created this Neovim-specific implementation with deep respect for the original work.

Features

  • πŸ” Review Diffs: Start review sessions between branches, commits, or uncommitted changes
  • πŸ’¬ Add Comments: Comment on single lines or ranges with context
  • βœ… Track Progress: Mark files as reviewed and monitor review status
  • πŸ“‹ Export Reviews: Submit reviews in Markdown or JSON format
  • 🎨 Flexible UI: Choose between builtin UI or Telescope integration

Requirements

Installation

Using lazy.nvim

{
  "KEY60228/reviewthem.nvim",
  dependencies = {
    "sindrets/diffview.nvim", -- optional (need at least one diff tool)
    "KEY60228/alt-diffview", -- alternative diff tool
    "nvim-telescope/telescope.nvim", -- optional
  },
  config = function()
    require("reviewthem").setup({
      -- your configuration here
    })
  end,
}
use {
  "KEY60228/reviewthem.nvim",
  requires = {
    "sindrets/diffview.nvim", -- optional (need at least one diff tool)
    "KEY60228/alt-diffview", -- alternative diff tool
    "nvim-telescope/telescope.nvim", -- optional
  },
  config = function()
    require("reviewthem").setup({
      -- your configuration here
    })
  end,
}

Configuration

require("reviewthem").setup({
  diff_tool = "diffview",              -- "diffview" or "alt-diffview"
  comment_sign = "πŸ’¬",                 -- Sign shown in gutter for comments
  submit_format = "markdown",          -- "markdown" or "json"
  submit_destination = "clipboard",    -- "clipboard" or file path
  ui = "builtin",                      -- "builtin" or "telescope"
  keymaps = {
    start_review = "<leader>rstart",
    add_comment = "<leader>rtc",
    submit_review = "<leader>rtsubmit",
    abort_review = "<leader>rtabort",
    show_comments = "<leader>rtsc",
    toggle_reviewed = "<leader>rtmr",
    show_status = "<leader>rtrs",
  },
  command_aliases = {
    review_start = "rts",              -- :rts expands to :ReviewThemStart
  },
})

Diff Tool Selection

When comparing a specific ref with the working tree (e.g., :ReviewThemStart main), we recommend using alt-diffview as your diff tool:

diff_tool = "alt-diffview",

This is because diffview.nvim may not properly display untracked files when comparing with the working tree. alt-diffview handles this scenario more reliably.

Usage

Basic Workflow

  1. Start a review session

    :ReviewThemStart main feature-branch

    Or review uncommitted changes:

    :ReviewThemStart
  2. Navigate and add comments

    • Use diffview to navigate through changes
    • Press <leader>rtc to add a comment on the current line
    • Select multiple lines in visual mode and press <leader>rtc for range comments
  3. Track your progress

    • Press <leader>rtmr to mark the current file as reviewed
    • Press <leader>rtrs to see overall review status
  4. Submit your review

    :ReviewThemSubmit

Commands

Command Description
:ReviewThemStart [base] [compare] Start a review session
:ReviewThemAddComment Add comment to current line/selection
:ReviewThemSubmit Submit all review comments
:ReviewThemAbort Abort current review session
:ReviewThemShowComments Show all comments
:ReviewThemMarkAsReviewed Mark current file as reviewed
:ReviewThemUnmarkAsReviewed Unmark current file as reviewed
:ReviewThemToggleReviewed Toggle reviewed status
:ReviewThemStatus Show review status of all files

Key Mappings

Default mappings (customizable in setup):

Mapping Mode Description
<leader>rstart n Start review
<leader>rtc n, v Add comment
<leader>rtsubmit n Submit review
<leader>rtabort n Abort review
<leader>rtsc n Show comments
<leader>rtmr n Toggle reviewed
<leader>rtrs n Show status

In the review status window:

  • t - Toggle reviewed status (builtin UI)
  • <C-t> - Toggle reviewed status (telescope UI)
  • q or <Esc> - Close window

Health Check

Run :checkhealth reviewthem to diagnose any issues with your setup.

Example Review Output

Markdown Format

# Code Review

**Base:** main
**Compare:** feature/new-feature
**Date:** 2024-01-15 10:30:00

## Comments

### src/main.lua

- **Line 42:** Consider extracting this logic into a separate function
- **Lines 55-60:** This could be simplified using a table lookup

### tests/main_spec.lua

- **Line 23:** Add test case for edge condition

JSON Format

{
  "review": {
    "base_ref": "main",
    "compare_ref": "feature/new-feature",
    "timestamp": "2024-01-15 10:30:00",
    "comments": [
      {
        "file": "src/main.lua",
        "line_start": 42,
        "line_end": 42,
        "comment": "Consider extracting this logic into a separate function"
      }
    ]
  }
}

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Roadmap

Planned Features

  • AddComment UX Improvements

    • Float window input for better writing experience
  • Mark as Reviewed UX Improvements

    • Display reviewed marks in file pane
  • ShowComments/ShowStatus UX Improvements

    • Press Enter to jump to diff view from comment/status list
  • Extended Diff Tool Support

    • Built-in diff mode support
    • Other popular diff tools
  • Extended UI Support

    • FZF integration
    • Other popular UI frameworks

Acknowledgments

  • ReviewIt - The original ReviewIt tool that inspired this Neovim plugin. Thank you for the wonderful idea and implementation!
  • diffview.nvim for the excellent diff viewing functionality
  • telescope.nvim for the fuzzy finder integration
  • Oh My Logo - The amazing tool used to create our logo. Thank you for making logo creation so simple and fun!

About

A Neovim plugin for streamlining code reviews directly in your editor. Inspired by ReviewIt.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages