Skip to content

sorena100/ireadcode.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ireadcode.nvim

Native Neovim review UI for changes recorded by ireadcode. Pending hunks are displayed directly in real file buffers and listed in Neovim's quickfix list. The plugin preserves the daemon's optimistic concurrency checks and never changes the Git index.

Requirements

  • Neovim 0.12 or newer.
  • The ireadcode executable on PATH, or configured with binary_path.
  • An ireadcode agent integration that records turn start/end events.

The plugin has no Lua plugin or HTTP-client dependency. It invokes the ireadcode CLI through Neovim's asynchronous process API; the CLI starts the loopback daemon when needed.

Install

With lazy.nvim:

{
  "your-org/ireadcode.nvim",
  opts = {},
}

For a local checkout:

{
  dir = "/home/ali/dev/ireadcode.nvim",
  opts = {},
}

Or call require("ireadcode").setup() after adding the repository to runtimepath.

Configuration

require("ireadcode").setup({
  binary_path = "ireadcode",
  poll_interval = 2000,
  quickfix_height = 10,
  keymaps = {
    accept = "<leader>la",
    reject = "<leader>lr",
    next = "]h",
    previous = "[h",
  },
})

Polling is clamped to 500 ms or more. The plugin refreshes after writes while review mode is active and stops polling when review mode is disabled or Neovim exits. Unchanged polls do not rebuild the quickfix list. When pending data changes, the selected hunk and quickfix viewport are preserved.

Review mode

Activating review mode fills the quickfix list with one entry per pending hunk. Opening an entry jumps to the real workspace file. Added/current lines are highlighted with DiffAdd and remain editable. Deleted/base lines are rendered above their corresponding current lines using virtual lines and DiffDelete; they are display-only and cannot be edited. Normal and context lines remain ordinary editable file content. Deleted lines respect each window's number, sign, and fold columns, follow horizontal scrolling, and fill the remaining text width with the deletion highlight.

Saving a reviewed file refreshes its disk-backed hunks. Accept and reject both require an unmodified buffer, so save or discard edits explicitly before deciding. Each action fetches a fresh review first, resolves the hunk nearest the cursor, and submits its current hash to the daemon.

Commands

Command Description
:IReadCode [workspace] Activate review mode and open its quickfix list.
:IReadCodeEnable [workspace] Activate review mode explicitly.
:IReadCodeDisable Clear decorations, mappings, polling, and the review quickfix list.
:IReadCodeToggle [workspace] Toggle review mode.
:IReadCodeRefresh Fetch current pending review data.
:IReadCodeAccept Accept the hunk nearest the cursor in the real file.
:IReadCodeReject Reject the hunk nearest the cursor in the real file.
:IReadCodeBase Open the current pending file's recorded base.
:IReadCodeTurns Display recorded agent turn history.
:IReadCodeRecover Finalize abandoned active turns after confirmation.

Pending file buffers map <leader>la to accept, <leader>lr to reject, ]h to move to the next quickfix hunk, and [h to move to the previous one. Navigation wraps at either end.

Accept and reject are disabled while any agent turn is active. Both refuse an unsaved buffer. The plugin passes the refreshed hunk's current hash to the CLI, so a concurrent change is rejected by the daemon instead of being overwritten from stale UI data.

Recovery is intentionally confirmed because it closes every active turn in the workspace and marks their history approximate. Only run it after confirming the agents are no longer running.

Development

nvim --headless -u NONE -l tests/run.lua

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages