diff --git a/config.org b/config.org index 7dadff7..63c1592 100644 --- a/config.org +++ b/config.org @@ -498,11 +498,45 @@ Hydra allows grouping of commands :ensure t :bind ("C-c f" . hydra-flycheck/body) + ("C-c g" . hydra-git-gutter/body) :config (setq-default hydra-default-hint nil) ) #+end_src +Some persistent navigation in git-gutter is nice, so here's a hydra for it: +#+BEGIN_SRC emacs-lisp +(defhydra hydra-git-gutter (:body-pre (git-gutter-mode 1) + :hint nil) + + " +^Git Gutter^ ^Git^ ^misc^ +^──────────^────────^───^────────────────^────^────────────────────────── +_j_: next hunk _s_tage hunk _q_uit +_k_: previous hunk _r_evert hunk _Q_uit and deactivate git-gutter +_h_: first hunk _p_opup hunk +_l_: last hunk set start _R_evision +^^ ^^ ^^ +" + ("j" git-gutter:next-hunk) + ("k" git-gutter:previous-hunk) + ("h" (progn (goto-char (point-min)) + (git-gutter:next-hunk 1))) + ("l" (progn (goto-char (point-min)) + (git-gutter:previous-hunk 1))) + ("s" git-gutter:stage-hunk) + ("r" git-gutter:revert-hunk) + ("p" git-gutter:popup-hunk) + ("R" git-gutter:set-start-revision) + ("q" nil :color blue) + ("Q" (progn (git-gutter-mode -1) + ;; git-gutter-fringe doesn't seem to + ;; clear the markup right away + (sit-for 0.1) + (git-gutter:clear)) + :color blue)) +#+END_SRC + * Undo #+BEGIN_SRC emacs-lisp