mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2026-10-08 00:54:18 +02:00
43 lines
1.3 KiB
EmacsLisp
43 lines
1.3 KiB
EmacsLisp
;; -*- lexical-binding: nil; -*-
|
|
;; *** Ediff Config
|
|
|
|
;; Force ediff to use 1 frame (the current) and not open a new frame
|
|
;; for control and help. Also changing the split orientation doesnt
|
|
;; open a new frame.
|
|
|
|
(eval-after-load "ediff"
|
|
'(progn
|
|
(setq ediff-diff-options "-w"
|
|
ediff-split-window-function 'split-window-horizontally
|
|
ediff-window-setup-function 'ediff-setup-windows-plain)
|
|
|
|
(add-hook 'ediff-startup-hook 'ediff-toggle-wide-display)
|
|
(add-hook 'ediff-cleanup-hook 'ediff-toggle-wide-display)
|
|
(add-hook 'ediff-suspend-hook 'ediff-toggle-wide-display)
|
|
|
|
(add-hook 'ediff-mode-hook
|
|
(lambda ()
|
|
(ediff-setup-keymap)
|
|
;; merge left to right
|
|
(define-key ediff-mode-map ">" 'ediff-copy-A-to-B)
|
|
;; merge right to left
|
|
(define-key ediff-mode-map "<" 'ediff-copy-B-to-A)))
|
|
|
|
;; restore window config on quit
|
|
(add-hook 'ediff-after-quit-hook-internal 'winner-undo)
|
|
))
|
|
|
|
;; from emacswiki:
|
|
;; Usage: emacs -diff file1 file2
|
|
(defun command-line-diff (switch)
|
|
(let ((file1 (pop command-line-args-left))
|
|
(file2 (pop command-line-args-left)))
|
|
(ediff file1 file2)))
|
|
(add-to-list 'command-switch-alist '("diff" . command-line-diff))
|
|
|
|
|
|
|
|
|
|
(provide 'init-ediff)
|
|
;;; init-ediff.el ends here
|