feat(fugitive): add status buffer keymaps for unified diffs
Adds du/dU keymaps to fugitive's :Git status buffer for opening unified diffs instead of side-by-side diffs: - du opens horizontal split (mirrors dd) - dU opens vertical split (mirrors dv) Parses status buffer lines to extract filename and detect section (staged/unstaged/untracked). For staged files, diffs index vs HEAD. For unstaged files, diffs working tree vs index. Configurable via vim.g.diffs.fugitive.horizontal/vertical (set to false to disable).
This commit is contained in:
parent
ea60ab8d01
commit
9289f33639
3 changed files with 186 additions and 0 deletions
|
|
@ -13,6 +13,13 @@ vim.api.nvim_create_autocmd('FileType', {
|
|||
return
|
||||
end
|
||||
diffs.attach(args.buf)
|
||||
|
||||
if args.match == 'fugitive' then
|
||||
local fugitive_config = diffs.get_fugitive_config()
|
||||
if fugitive_config.horizontal or fugitive_config.vertical then
|
||||
require('diffs.fugitive').setup_keymaps(args.buf, fugitive_config)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue