Skip to content

nvim quick diffs#24

Merged
Vilos92 merged 2 commits into
mainfrom
nvim-quick-diffs
Jun 22, 2026
Merged

nvim quick diffs#24
Vilos92 merged 2 commits into
mainfrom
nvim-quick-diffs

Conversation

@Vilos92

@Vilos92 Vilos92 commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Added Git Changed Tabs to open tabs for modified and untracked files, plus shortcuts to access it and preview changes.
    • Expanded Git inline diff support with improved hunk navigation and word-level diff toggling.
  • Improvements
    • Improved Git visualization compatibility with the transparency setup by excluding GitSigns highlight groups.
    • Updated sign column behavior to be adaptive (auto).
  • Bug Fixes
    • Improved GitSigns startup/refresh behavior when the plugin is newly installed or updated (including safe handling in VSCode).

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c9e9b1f9-e636-4cc1-8751-86033e06ca7a

📥 Commits

Reviewing files that changed from the base of the PR and between 4428433 and 4d0fbdf.

📒 Files selected for processing (1)
  • nvim/.config/nvim/lua/greg/git.lua
🚧 Files skipped from review as they are similar to previous changes (1)
  • nvim/.config/nvim/lua/greg/git.lua

📝 Walkthrough

Walkthrough

Adds gitsigns.nvim as a pinned plugin with a new greg/gitsigns.lua setup module and a new greg/git.lua module that detects unstaged and untracked files and opens each in a tab. Plugin loading is wired through pack.lua, a lock file entry, and an after-plugin loader. The starter menu, transparency exclusions, and signcolumn setting are updated to integrate the new functionality.

Changes

Gitsigns Integration

Layer / File(s) Summary
New git.lua: changed_files and open_changed_tabs
nvim/.config/nvim/lua/greg/git.lua
Adds git_root() and append_nul_paths() helpers, M.changed_files() collecting unstaged/untracked paths via git diff and git ls-files, is_starter_tab() checking for ministarter filetype, and M.open_changed_tabs() opening each file in a new tab and closing the originating home tab.
New gitsigns.lua: M.setup() with guards and keymaps
nvim/.config/nvim/lua/greg/gitsigns.lua
Adds greg.gitsigns module with a setup_done guard and VSCode early-exit, full gitsigns.setup() configuration including sign glyphs, word_diff, numhl, on_attach hunk navigation keymaps, and global mappings for open_changed_tabs and word diff toggle.
Plugin registration, lock file, and after-plugin loader
nvim/.config/nvim/lua/greg/pack.lua, nvim/.config/nvim/nvim-pack-lock.json, nvim/.config/nvim/after/plugin/gitsigns.lua
Pins lewis6991/gitsigns.nvim to a specific commit in pack.lua with a PackChanged handler that defers require("greg.gitsigns"); records the lock entry; adds the after-plugin loader with a VSCode guard and its own PackChanged autocmd for deferred setup on first-launch async installation.
Starter menu item, transparency exclusions, and signcolumn
nvim/.config/nvim/after/plugin/starter.lua, nvim/.config/nvim/after/plugin/transparent.lua, nvim/.config/nvim/lua/greg/set.lua
Adds a "Git Changed Tabs" MiniStarter entry under Explorer, excludes GitSigns* highlight groups from the transparency plugin's group handling, and changes signcolumn from "yes" to "auto".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 A hop through the diff, a skip through the tree,
New tabs spring open for all files to see!
Gitsigns now glows with its colors intact,
Transparency skips them — a deliberate pact.
The sign column breathes, set to "auto" with grace,
A rabbit's own dotfiles, a tidy workspace! 🌿

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'nvim quick diffs' is vague and generic, using a non-descriptive term that doesn't clearly convey the specific changes made in the changeset. Consider a more descriptive title such as 'Add gitsigns integration with quick diff tab navigation' or 'Integrate gitsigns plugin with git change tracking' to better communicate the main purpose of this pull request.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nvim-quick-diffs

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@nvim/.config/nvim/lua/greg/git.lua`:
- Around line 82-91: The code unconditionally closes the user's original tab
with vim.cmd.tabclose(home_tab) which can fail on modified buffers and lose
context, and then uses vim.cmd.tabfirst() which may jump to unrelated existing
tabs instead of the newly opened ones. Remove the vim.cmd.tabclose(home_tab)
call entirely to preserve the caller's tab, and replace vim.cmd.tabfirst() with
navigation to the first newly opened tab by using vim.cmd.tabnext with home_tab
to jump to the first changed-file tab that was opened in the loop.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5699cc44-4e50-47ca-bd73-e311aa064de1

📥 Commits

Reviewing files that changed from the base of the PR and between ea1ec69 and 4428433.

📒 Files selected for processing (8)
  • nvim/.config/nvim/after/plugin/gitsigns.lua
  • nvim/.config/nvim/after/plugin/starter.lua
  • nvim/.config/nvim/after/plugin/transparent.lua
  • nvim/.config/nvim/lua/greg/git.lua
  • nvim/.config/nvim/lua/greg/gitsigns.lua
  • nvim/.config/nvim/lua/greg/pack.lua
  • nvim/.config/nvim/lua/greg/set.lua
  • nvim/.config/nvim/nvim-pack-lock.json

Comment thread nvim/.config/nvim/lua/greg/git.lua Outdated
@Vilos92 Vilos92 merged commit a23ac82 into main Jun 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant