Add diffview.nvim for reviewing diffs and file history
Installed via vim.pack, matching how the other plugins here are managed. Adds a new <leader>g "diff" group: gd opens a Diffview against the index, gc closes it, gh shows history for the current file, gH for the branch. Verified headlessly: config/plugins loads clean, :DiffviewOpen is registered, and opening/closing a Diffview against this repo works with no errors. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013t7aQbc4EyYtab1crvSFTd
This commit is contained in:
parent
f8d525b7eb
commit
37253c8a7b
4 changed files with 18 additions and 0 deletions
12
neovim/config/plugins/diffview.lua
Normal file
12
neovim/config/plugins/diffview.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
vim.pack.add({ 'https://github.com/sindrets/diffview.nvim' })
|
||||
|
||||
require('diffview').setup()
|
||||
|
||||
local function map(lhs, rhs, desc)
|
||||
vim.keymap.set('n', lhs, rhs, { desc = desc })
|
||||
end
|
||||
|
||||
map('<leader>gd', '<Cmd>DiffviewOpen<CR>', 'Diff against index')
|
||||
map('<leader>gc', '<Cmd>DiffviewClose<CR>', 'Close diff view')
|
||||
map('<leader>gh', '<Cmd>DiffviewFileHistory %<CR>', 'File history')
|
||||
map('<leader>gH', '<Cmd>DiffviewFileHistory<CR>', 'Branch history')
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
require('config.plugins.diffview')
|
||||
require('config.plugins.fzf-lua')
|
||||
require('config.plugins.gitsigns')
|
||||
require('config.plugins.nvim-tree')
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ wk.setup()
|
|||
wk.add({
|
||||
{ '<leader>d', group = 'diagnostics' },
|
||||
{ '<leader>f', group = 'find' },
|
||||
{ '<leader>g', group = 'diff' },
|
||||
{ '<leader>h', group = 'hunks' },
|
||||
{ '<leader>t', group = 'toggles' },
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue