feature(delta): automagically set delta to default git diff
[webi-installers/.git] / delta / README.md
1 ---
2 title: delta
3 homepage: https://github.com/dandavison/delta
4 tagline: |
5   delta: A syntax-highlighting pager for git and diff output
6 ---
7
8 To update or switch versions, run `webi delta` (or `@0.9.1`, `@0.9.0`, etc).
9
10 **Note**: You should install [git](./git) before installing `delta`.
11
12 ## Cheat Sheet
13
14 > `delta` gives you GitHub-style diffs, with word-level diff coloring, right in
15 > your trusty rusty terminal.
16
17 ![](https://user-images.githubusercontent.com/52205/65248525-32250480-daea-11e9-9965-1a05c6a4bdf4.png)
18
19 Here we'll cover:
20
21 - **The install**: which files are added or changed
22 - **Configuration**: how to set a syntax theme
23 - **Preview**: how to list or show the color schemes
24 - **Manual Config**: how to turn `delta` on or off for git diffs
25
26 For the full set of options, be sure to check out the helpful
27 [README](https://github.com/dandavison/delta).
28
29 ## Files
30
31 These are the files that are created and/or modified with this installer:
32
33 ```txt
34 ~/.config/envman/PATH.env
35 ~/.gitconfig
36 ~/.local/bin/delta
37 ~/.local/opt/delta-VERSION/bin/delta
38 ```
39
40 ## How to set delta's color scheme
41
42 Delta uses `~/.gitconfig` for most of its options.
43
44 Set `delta.syntax-theme` to change the color scheme:
45
46 ```bash
47 git config delta.syntax-theme 'Coldark-Dark'
48 ```
49
50 ## How to list / preview delta's themes
51
52 You can list all available themes with `--list-syntax-themes`, or see each color
53 schemes in action with `--show-syntax-themes`:
54
55 ```bash
56 delta --list-syntax-themes --dark
57 delta --show-syntax-themes --dark
58 ```
59
60 You can also show only light or dark themes:
61
62 ```bash
63 delta --list-syntax-themes --light
64 delta --show-syntax-themes --light
65 ```
66
67 ```bash
68 delta --list-syntax-themes --dark
69 delta --show-syntax-themes --dark
70 ```
71
72 Here's the current list, for convenience:
73
74 ### Dark Syntax Themes
75
76 ```txt
77 1337
78 Coldark-Cold
79 Coldark-Dark
80 DarkNeon
81 Dracula
82 Monokai Extended
83 Monokai Extended Bright
84 Monokai Extended Origin
85 Nord
86 OneHalfDark
87 Solarized (dark)
88 Sublime Snazzy
89 TwoDark
90 Visual Studio Dark+
91 ansi
92 base16
93 base16-256
94 gruvbox-dark
95 zenburn
96 ```
97
98 ### Light Syntax Themes
99
100 ```txt
101 GitHub
102 Monokai Extended Light
103 OneHalfLight
104 Solarized (light)
105 gruvbox-light
106 ```
107
108 ## How to manually configure git to use delta
109
110 You can use `git config --global` to get or set any arbitrary option of
111 `~/.gitconfig`.
112
113 ```bash
114 git config --global page.diff delta
115 git config --global page.show delta
116 git config --global page.log delta
117 git config --global page.blame delta
118 git config --global page.reflog delta
119
120 git config --global interactive.diffFilter 'delta --color-only'
121
122 git config delta.syntax-theme 'Coldark-Dark'
123 ```
124
125 Your `~/.gitconfig` will then contain these sections and options:
126
127 ```gitconfig
128 [pager]
129     diff = delta
130     show = delta
131     log = delta
132     blame = delta
133     reflog = delta
134
135 [interactive]
136     diffFilter = delta --color-only
137
138 [delta]
139     syntax-theme = Coldark-Dark
140 ```