Skip to content

goropikari/gitdiff.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitdiff.nvim

Pick files changed between a selected Git branch and HEAD with snacks.nvim.

Requirements

Installation

{
  "goropikari/gitdiff.nvim",
  dependencies = { "folke/snacks.nvim" },
  opts = {},
}

Commands

  • :GitDiffFiles: open the changed-file picker using Snacks.picker.git_diff({ group = true }). If no branch is remembered for the current worktree, opens the branch picker first.
  • :GitDiffBranch: choose a base branch, remember it for the current worktree, then open the changed-file picker.
  • :GitDiffReset: forget the remembered branch for the current worktree.

Lua API

require("gitdiff").files()
require("gitdiff").branch()
require("gitdiff").reset()
require("gitdiff").reset({ all = true })

Behavior

gitdiff.nvim delegates the main file picker to snacks.nvim:

Snacks.picker.git_diff({
  base = branch.refname,
  group = true,
})

The selected branch is remembered only for the current Neovim session and is keyed by git rev-parse --show-toplevel, so separate worktrees can remember different base branches.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors