aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2023-06-27 09:34:11 +1000
committerYuchen Pei <id@ypei.org>2023-06-27 09:34:11 +1000
commit4edc5f34347efbc4422947bde97f95918d29229e (patch)
tree3f7d4607598752770657e36b9b225c62f0002b77
parent8c515e3b6efdcfecc213b56c860fccac2d9138cf (diff)
dired and vc
-rw-r--r--.gitmodules3
-rw-r--r--emacs/.emacs.d/init/ycp-dired.el10
-rw-r--r--emacs/.emacs.d/init/ycp-vc.el20
m---------emacs/.emacs.d/lisp/buildbot.el0
m---------emacs/.emacs.d/lisp/dired-hist0
-rw-r--r--emacs/.emacs.d/lisp/my/my-dired.el12
6 files changed, 43 insertions, 2 deletions
diff --git a/.gitmodules b/.gitmodules
index 733000b..099b2e8 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -82,3 +82,6 @@
[submodule "emacs/.emacs.d/lisp/ox-jira.el"]
path = emacs/.emacs.d/lisp/ox-jira.el
url = https://github.com/stig/ox-jira.el
+[submodule "emacs/.emacs.d/lisp/dired-hist"]
+ path = emacs/.emacs.d/lisp/dired-hist
+ url = https://github.com/karthink/dired-hist
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
"<return>" #'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
-Subproject d3c7fcb511d1697f27e84229172152cdab81235
+Subproject 8c151a133ffcc3bb1d4e8e23bc071d32785185c
diff --git a/emacs/.emacs.d/lisp/dired-hist b/emacs/.emacs.d/lisp/dired-hist
new file mode 160000
+Subproject 94b09260ac964e3d856c018d66af3214915dd82
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