diff --git a/.config/guix/manifests/emacs.scm b/.config/guix/manifests/emacs.scm index 6f277b6..58ba341 100644 --- a/.config/guix/manifests/emacs.scm +++ b/.config/guix/manifests/emacs.scm @@ -18,4 +18,5 @@ "python-black" "python-yapf" "plantuml" + "difftastic-bin" "xkb-switch")) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 9374eee..c339ed9 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -619,6 +619,41 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." :straight t :commands (git-timemachine)) +(use-package difftastic + :straight t + :commands (difftastic-magit-diff + difftastic-magit-show + difftastic-files + difftastic-buffers) + :init + (with-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)]) + (general-define-key + :keymaps 'magit-blame-read-only-mode-map + :states 'normal + "D" #'difftastic-magit-show + "S" #'difftastic-magit-show)) + :config + (setq difftastic-executable (executable-find "difft")) + (general-define-key + :keymaps 'difftastic-mode-map + :states '(normal) + "gr" #'difftastic-rerun + "q" #'kill-buffer-and-window)) + +(defun my/difftastic-pop-at-bottom (buffer-or-name _requested-width) + (let ((window (split-window-below))) + (select-window window) + (evil-move-window 'below)) + (set-window-buffer (selected-window) buffer-or-name)) + +(setq difftastic-display-buffer-function #'my/difftastic-pop-at-bottom) + +(setq difftastic-requested-window-width-function + (lambda () (- (frame-width) 4))) + (use-package forge :after magit :straight t @@ -828,7 +863,8 @@ Obeys `widen-automatically', which see." dired-recent-open org-ql-view my/index-nav - org-set-effort)) + org-set-effort + eshell-atuin-history)) ;; Do not use prescient in find-file (ivy--alist-set 'ivy-sort-functions-alist #'read-file-name-internal #'ivy-sort-file-function-default)) @@ -3209,7 +3245,8 @@ With ARG, repeats or can move backward if negative." (plantuml . t) (octave . t) ,@(unless my/is-termux '((jupyter . t))) - (sparql . t))) + (sparql . t) + (gnuplot . t))) (add-hook 'org-babel-after-execute-hook 'org-redisplay-inline-images)) @@ -4403,11 +4440,11 @@ KEYS is a list of cons cells like (