]> code.delx.au - gnu-emacs-elpa/blob - README.md
diff-hl-revert-hunk: Recenter the window on the hunk, if possible
[gnu-emacs-elpa] / README.md
1 About
2 =====
3
4 `diff-hl-mode` provides IDE-like highlighting of `vc-diff` results on the left
5 fringe of the current buffer.
6
7 Since it uses the corresponding VC diff command, it's only accurate when the
8 buffer is in saved state.
9
10 Additionally, it defines and binds
11
12 * `diff-hl-diff-goto-hunk` (`C-x v =`)
13 * `diff-hl-revert-hunk` (`C-x v n`)
14 * `diff-hl-previous-hunk` (`C-x v [`)
15 * `diff-hl-next-hunk` (`C-x v ]`)
16
17 The mode takes advantage of `smartrep` if it is installed.
18
19 Tested with Git, Mercurial, and Bazaar. May work with other VC backends, too.
20
21 Usage
22 =====
23
24 Ensure `diff-hl.el` is in a directory on your load-path, and add the following
25 to your `~/.emacs` or `~/.emacs.d/init.el`
26
27 (require 'diff-hl)
28
29 and, to use it in all buffers
30
31 (global-diff-hl-mode)
32
33 or, for example, to use it in all `prog-mode` and `vc-dir-mode` buffers
34
35 (add-hook 'prog-mode-hook 'turn-on-diff-hl-mode)
36 (add-hook 'vc-dir-mode-hook 'turn-on-diff-hl-mode)