Compare commits

...

8 Commits

3 changed files with 69 additions and 12 deletions

View File

@@ -44,20 +44,35 @@
;; prefix. So just a hydra will do. ;; prefix. So just a hydra will do.
(when (fboundp 'defhydra) (when (fboundp 'defhydra)
(defhydra hydra-smerge (:color blue :timeout 30.0) (defhydra hydra-smerge (:timeout 30.0 :exit nil)
" "
^Smerge Mode^ ^Smerge Mode^
^^------------------------------------------------------- ^^--------------------------------------------------------------
_n_ext conflict keep _u_pper m_e_rge conflicts in Ediff _n_: next conflict _u_: keep upper _s_: swap
_p_revious conflict keep _l_ower _q_uit" _p_: prev conflict _l_: keep lower _h_: highlight
_e_: Ediff _b_: keep base _r_: resolve
_q_: quit _RET_: keep hunk@point _R_: revert
("n" smerge-next nil :exit nil) ^^--------------------------------------------------------------
("p" smerge-prev nil :exit nil) Reach this hydra with <C-x m>
("u" smerge-keep-upper nil :exit nil) ^^--------------------------------------------------------------
("l" smerge-keep-lower nil :exit nil)
("e" smerge-ediff nil :color red)
("q" nil nil :color red))
"
("n" smerge-next nil)
("p" smerge-prev nil)
("u" smerge-keep-upper nil)
("l" smerge-keep-lower nil)
("b" smerge-keep-base nil)
("RET" smerge-keep-current nil)
("h" smerge-refine nil)
("s" smerge-swap nil)
("r" smerge-resolve nil)
("R" undo-tree-undo nil)
("e" smerge-ediff nil :color blue)
("q" nil nil :color blue))
(global-set-key (kbd "C-x m") 'hydra-smerge/body)
(defalias 'merge 'hydra-smerge/body)) (defalias 'merge 'hydra-smerge/body))

View File

@@ -1,6 +1,29 @@
;; *** Magit ;; *** Magit
;; TODO: add blamer.el (https://github.com/Artawower/blamer.el), currently fails to install (2023/05/08) (when (fboundp 'defhydra)
(defhydra hydra-blame (:timeout 30.0 :exit nil)
"
^Blame Mode^
^^--------------------------------------------------------------
_n_: next chunk _M-w_: copy commit hash hash
_p_: prev chunk _c_: cycle style
_N_: next chunk same commit _RET_: show current commit
_P_: prev chunk same commit _q_: quit blame mode
^^--------------------------------------------------------------
Reach this hydra with <C-x B>, magit-blame mode must be active
^^--------------------------------------------------------------
"
("n" magit-blame-next-chunk nil)
("p" magit-blame-previous-chunk nil)
("N" magit-blame-next-chunk-same-commit nil)
("P" magit-blame-previous-chunk-same-commit nil)
("M-w" magit-blame-copy-hash nil)
("RET" magit-show-commit nil)
("c" magit-blame-cycle-style nil)
("q" nil nil :color blue)))
;; Not much to say about Magit ;; Not much to say about Magit
(use-package magit (use-package magit
@@ -15,6 +38,14 @@
;; the hassle to go to status before just committing etc. So: ;; the hassle to go to status before just committing etc. So:
(("C-c g" . magit-file-dispatch)) (("C-c g" . magit-file-dispatch))
:hook
;; automatically fire up smerge hydra when visiting a buffer
;; containing merge conflict[s]. Hydra see init-ediff.el
(magit-diff-visit-file . (lambda () (hydra-smerge/body)))
// automatically fire up blame hydra, see definition above ont top
(magit-blame-mode . (lambda () (hydra-blame/body)))
:config :config
(magit-todos-mode) (magit-todos-mode)
@@ -124,7 +155,17 @@
(magit-restore-window-configuration) (magit-restore-window-configuration)
(mapc #'kill-buffer buffers))) (mapc #'kill-buffer buffers)))
(define-key magit-status-mode-map (kbd "q") #'tvd-kill-magit-buffers)) (define-key magit-status-mode-map (kbd "q") #'tvd-kill-magit-buffers)
(defun tvd-blame-mode()
(interactive)
(if (not magit-blame-mode)
(progn
(magit-blame)
(hydra-blame/body))))
(global-set-key (kbd "C-x B") 'tvd-blame-mode)
)
(use-package blamer (use-package blamer

View File

@@ -198,6 +198,7 @@ targets."
:bind (;; C-c bindings in `mode-specific-map' :bind (;; C-c bindings in `mode-specific-map'
("C-x b" . consult-buffer) ("C-x b" . consult-buffer)
("C-c C-j" . consult-imenu) ("C-c C-j" . consult-imenu)
("s-s" . consult-line)
("C-x C-r" . consult-recent-file)) ;; replaces recentf ("C-x C-r" . consult-recent-file)) ;; replaces recentf
;; Enable automatic preview at point in the *Completions* buffer. This is ;; Enable automatic preview at point in the *Completions* buffer. This is