我的设置:
(add-to-list 'load-path "~/.config/emacs/extensions/diff-lisp")
(require 'diff-lisp)
(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)
实现了和 Alfred Workflow FastDiff 类似的复用一个快捷键的功能。
我的 Alfred Workflow:
修改自九年前的原版 FastDiff: