Closed suliveevil closed 1 year ago
I don't think diff-lisp
is fit for your workflow, it does not provide UI like vimdiff
. But there are other packages in Emacs similar to vimdiff
In Emacs, most people use ediff
.
You can use Emacs cli, emacs --eval "(ediff-files \"/path/file1\" \"/path/file2\")"
to trigger ediff through shell.
The point is repeatable/reusable keybinding, not UI or what diff tools to choose 😂
https://github.com/jdtsmith/mlscroll/issues/16#issuecomment-1328165610
Take C-x C-d
as default keybinding:
First trigger, diff-lisp get A, second trigger, diff-lisp get B.
(defvar diff-lisp-set-a-and-b nil)
(defun diff-lisp-set-a-and-b ()
(interactive)
(if (eq diff-lisp-set-a-and-b nil)
(progn
(diff-lisp-mark-selected-text-as-a)
(setq diff-lisp-set-a-and-b t)
)
(progn
(diff-lisp-diff-a-and-b)
(setq diff-lisp-set-a-and-b nil)
))
)
(keymap-global-set "s-/" #'diff-lisp-set-a-and-b)
I have this Alfred Workflow on macOS:
https://github.com/monkeycz/alfred-fastdiff
It use only one keybinding choose a and b.
How to setup diff-lisp like this? Thank you very much!