summaryrefslogtreecommitdiff
path: root/modules/vc-config.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-11-03 16:10:13 -0600
committerCraig Jennings <c@cjennings.net>2025-11-03 16:10:13 -0600
commitaea61b34693f164ced731cf3b0f0e8ee798c342c (patch)
tree1db40a1c366ad9111c07bb17d1060eab99d851e2 /modules/vc-config.el
parent4a7eb7fcf6f90574b92337a280a202808a969772 (diff)
feat: Upgrade diff-buffer-with-file to ediff and add difftastic for git
Two improvements for better diff experience: 1. **Upgraded cj/diff-buffer-with-file to use ediff** (custom-buffer-file.el) - Replaced basic unified diff with ediff-current-file - Now uses existing ediff config (horizontal split, j/k navigation) - C-; b D now launches interactive ediff instead of text diff - Simplified from 17 lines to 5 lines - Removed TODO comment about difftastic integration 2. **Added difftastic for git diffs** (vc-config.el) - Installed binary: difftastic 0.64.0 via pacman - Added difftastic.el package integrated with magit - Keybindings in magit-diff: - D → difftastic-magit-diff (dwim) - S → difftastic-magit-show - Provides structural, language-aware diffs for git changes - Better visualization of code structure changes **Result:** - Buffer vs file: Interactive ediff (can navigate, merge, revert) - Git history: Structural difftastic (language-aware visualization) - Right tool for each job Serves Method 3: "Make Fixing Emacs Frictionless" - Better diffs = easier debugging and code review Updated todo.org: Method 1 progress 7/13 (was 5/13) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'modules/vc-config.el')
-rw-r--r--modules/vc-config.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/vc-config.el b/modules/vc-config.el
index 21a4380c..b9b61c29 100644
--- a/modules/vc-config.el
+++ b/modules/vc-config.el
@@ -123,6 +123,21 @@ interactive selection to jump to any changed line in the buffer."
(require 'git-gutter)
(consult-line "^[+\\-]"))
+;; -------------------------------- Difftastic ---------------------------------
+;; Structural diffs for better git change visualization
+
+(use-package difftastic
+ :demand t
+ :after magit
+ :bind (:map magit-blame-read-only-mode-map
+ ("D" . difftastic-magit-show)
+ ("S" . difftastic-magit-show))
+ :config
+ (eval-after-load 'magit-diff
+ '(transient-append-suffix 'magit-diff '(-1 -1)
+ [("D" "Difftastic diff (dwim)" difftastic-magit-diff)
+ ("S" "Difftastic show" difftastic-magit-show)])))
+
;; --------------------------------- VC Keymap ---------------------------------
;; Ordering & sorting prefix and keymap