From 4edc5f34347efbc4422947bde97f95918d29229e Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 27 Jun 2023 09:34:11 +1000 Subject: dired and vc --- emacs/.emacs.d/init/ycp-dired.el | 10 +++++++++- emacs/.emacs.d/init/ycp-vc.el | 20 +++++++++++++++++++- emacs/.emacs.d/lisp/buildbot.el | 2 +- emacs/.emacs.d/lisp/dired-hist | 1 + emacs/.emacs.d/lisp/my/my-dired.el | 12 ++++++++++++ 5 files changed, 42 insertions(+), 3 deletions(-) create mode 160000 emacs/.emacs.d/lisp/dired-hist (limited to 'emacs') diff --git a/emacs/.emacs.d/init/ycp-dired.el b/emacs/.emacs.d/init/ycp-dired.el index badd8ed..056bfce 100644 --- a/emacs/.emacs.d/init/ycp-dired.el +++ b/emacs/.emacs.d/init/ycp-dired.el @@ -54,7 +54,8 @@ "a" #'my-dired-find-or-alternate "" #'my-dired-find-or-alternate "r" #'my-dired-do-rename-and-symlink-back - "s" #'my-dired-toggle-sorting) + "s" #'my-dired-toggle-sorting + "F" #'my-dired-follow-mode) (advice-add 'dired-do-delete :around 'my-dired-do-delete) (advice-add 'dired-do-rename :around 'my-dired-do-rename) ) @@ -85,6 +86,13 @@ (setq dired-bind-info nil) (my-keybind dired-mode-map "I" #'dired-info)) +(my-package dired-hist + (:delay 5) + (my-keybind dired-mode-map + "l" #'dired-hist-go-back + "r" #'dired-hist-go-forward) + (dired-hist-mode 1)) + ;;; required by dired-subtree (my-package dash (:delay 5) diff --git a/emacs/.emacs.d/init/ycp-vc.el b/emacs/.emacs.d/init/ycp-vc.el index 251714d..7496cef 100644 --- a/emacs/.emacs.d/init/ycp-vc.el +++ b/emacs/.emacs.d/init/ycp-vc.el @@ -47,11 +47,29 @@ (my-package ediff (:delay 30) -;;;; `ediff' + (my-keybind global-map + "C-c = b" #'ediff-buffers + "C-c = B" #'ediff-buffers3 + "C-c = c" #'compare-windows + "C-c = =" #'ediff-files + "C-c = f" #'ediff-files + "C-c = F" #'ediff-files3 + "C-c = m" #'count-matches + "C-c = r" #'ediff-revision + "C-c = p" #'ediff-patch-file + "C-c = P" #'ediff-patch-buffer + "C-c = l" #'ediff-regions-linewise + "C-c = w" #'ediff-regions-wordwise) (setq ediff-keep-variants nil) (setq ediff-make-buffers-readonly-at-startup nil) (setq ediff-show-clashes-only t) (setq ediff-split-window-function 'split-window-horizontally) + (setq ediff-combination-pattern + '("<<<<<<< A: HEAD" A + "||||||| Ancestor" Ancestor + "=======" + B ">>>>>>> B: Incoming")) + (setq ediff-diff-options "-w") ) (my-package vc-git diff --git a/emacs/.emacs.d/lisp/buildbot.el b/emacs/.emacs.d/lisp/buildbot.el index d3c7fcb..8c151a1 160000 --- a/emacs/.emacs.d/lisp/buildbot.el +++ b/emacs/.emacs.d/lisp/buildbot.el @@ -1 +1 @@ -Subproject commit d3c7fcb511d1697f27e84229172152cdab812351 +Subproject commit 8c151a133ffcc3bb1d4e8e23bc071d32785185c2 diff --git a/emacs/.emacs.d/lisp/dired-hist b/emacs/.emacs.d/lisp/dired-hist new file mode 160000 index 0000000..94b0926 --- /dev/null +++ b/emacs/.emacs.d/lisp/dired-hist @@ -0,0 +1 @@ +Subproject commit 94b09260ac964e3d856c018d66af3214915dd826 diff --git a/emacs/.emacs.d/lisp/my/my-dired.el b/emacs/.emacs.d/lisp/my/my-dired.el index d80c1c8..c64d9d2 100644 --- a/emacs/.emacs.d/lisp/my/my-dired.el +++ b/emacs/.emacs.d/lisp/my/my-dired.el @@ -139,5 +139,17 @@ With a prefix-arg, call it without using `vc-rename-file'." (funcall rename-fun)) (funcall rename-fun))) +(defun my-dired-display-file (_) + (dired-display-file)) + +(define-minor-mode my-dired-follow-mode + "Diplay file at point in dired after a move." + :lighter " dired-f" + :global t + :group 'dired + (if my-dired-follow-mode + (advice-add 'dired-next-line :after #'my-dired-display-file) + (advice-remove 'dired-next-line #'my-dired-display-file))) + (provide 'my-dired) ;;; my-dired.el ends here -- cgit v1.2.3