mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
Customize ediff-mode used by magit
This commit is contained in:
25
modules/siren-ediff.el
Normal file
25
modules/siren-ediff.el
Normal file
@@ -0,0 +1,25 @@
|
||||
;;; siren-ediff.el --- jimeh's Emacs Siren: ediff configuration.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Basic configuration for ediff.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defun ediff-copy-both-to-C ()
|
||||
"Copy both A and B variants to C."
|
||||
(interactive)
|
||||
(ediff-copy-diff
|
||||
ediff-current-difference nil 'C nil
|
||||
(concat
|
||||
(ediff-get-region-contents ediff-current-difference 'A ediff-control-buffer)
|
||||
(ediff-get-region-contents ediff-current-difference 'B ediff-control-buffer))))
|
||||
|
||||
(defun add-B-to-ediff-mode-map ()
|
||||
"Assign B key to copy both A and B variants to C."
|
||||
(define-key ediff-mode-map "B" 'ediff-copy-both-to-C))
|
||||
|
||||
(add-hook 'ediff-keymap-setup-hook 'add-B-to-ediff-mode-map)
|
||||
|
||||
(provide 'siren-ediff)
|
||||
;;; siren-ediff.el ends here
|
||||
@@ -9,6 +9,7 @@
|
||||
(siren-require-packages '(magit))
|
||||
|
||||
(require 'siren-fci)
|
||||
(require 'siren-ediff)
|
||||
(require 'magit)
|
||||
|
||||
(setq magit-completing-read-function 'magit-ido-completing-read)
|
||||
@@ -24,9 +25,6 @@
|
||||
(setq magit-display-buffer-function
|
||||
'magit-display-buffer-same-window-except-diff-v1)
|
||||
|
||||
(global-set-key (kbd "C-x g") 'magit-status)
|
||||
(defalias 'bl 'magit-blame)
|
||||
|
||||
;; Configure magit-mode
|
||||
(defun siren-magit-mode-defaults ()
|
||||
;; (linum-mode t) ;; Causes magit to freeze sometimes
|
||||
@@ -50,5 +48,12 @@
|
||||
(add-hook 'git-commit-mode-hook (lambda ()
|
||||
(run-hooks 'siren-git-commit-mode-hook)))
|
||||
|
||||
;; Keybindings
|
||||
(global-set-key (kbd "C-x g") 'magit-status)
|
||||
|
||||
;; Aliases
|
||||
(defalias 'bl 'magit-blame)
|
||||
|
||||
|
||||
(provide 'siren-magit)
|
||||
;;; siren-magit.el ends here
|
||||
|
||||
Reference in New Issue
Block a user