mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-08-19 03:56:16 +00:00
docs(delta): add all sorts of goodies to cheat sheet
This commit is contained in:
+116
-5
@@ -5,12 +5,122 @@ tagline: |
|
||||
delta: A syntax-highlighting pager for git and diff output
|
||||
---
|
||||
|
||||
To update or switch versions, run `webi delta` (or `@0.9.1`, `@0.9.0`,
|
||||
etc).
|
||||
To update or switch versions, run `webi delta` (or `@0.9.1`, `@0.9.0`, etc).
|
||||
|
||||
## Cheat Sheet
|
||||
|
||||
Install delta and add this to your `~/.gitconfig`:
|
||||
> `delta` gives you GitHub-style diffs, with word-level diff coloring, right in
|
||||
> your trusty rusty terminal.
|
||||
|
||||

|
||||
|
||||
Here we'll cover:
|
||||
|
||||
- **The install**: which files are added or changed
|
||||
- **Configuration**: how to set a syntax theme
|
||||
- **Preview**: how to list or show the color schemes
|
||||
- **Manual Config**: how to turn `delta` on or off for git diffs
|
||||
|
||||
For the full set of options, be sure to check out the helpful
|
||||
[README](https://github.com/dandavison/delta).
|
||||
|
||||
## Files
|
||||
|
||||
These are the files that are created and/or modified with this installer:
|
||||
|
||||
```txt
|
||||
~/.config/envman/PATH.env
|
||||
~/.gitconfig
|
||||
~/.local/bin/delta
|
||||
~/.local/opt/delta-VERSION/bin/delta
|
||||
```
|
||||
|
||||
## How to set delta's color scheme
|
||||
|
||||
Delta uses `~/.gitconfig` for most of its options.
|
||||
|
||||
Set `delta.syntax-theme` to change the color scheme:
|
||||
|
||||
```bash
|
||||
git config delta.syntax-theme 'Coldark-Dark'
|
||||
```
|
||||
|
||||
## How to list / preview delta's themes
|
||||
|
||||
You can list all available themes with `--list-syntax-themes`, or see each color
|
||||
schemes in action with `--show-syntax-themes`:
|
||||
|
||||
```bash
|
||||
delta --list-syntax-themes --dark
|
||||
delta --show-syntax-themes --dark
|
||||
```
|
||||
|
||||
You can also show only light or dark themes:
|
||||
|
||||
```bash
|
||||
delta --list-syntax-themes --light
|
||||
delta --show-syntax-themes --light
|
||||
```
|
||||
|
||||
```bash
|
||||
delta --list-syntax-themes --dark
|
||||
delta --show-syntax-themes --dark
|
||||
```
|
||||
|
||||
Here's the current list, for convenience:
|
||||
|
||||
### Dark Syntax Themes
|
||||
|
||||
```txt
|
||||
1337
|
||||
Coldark-Cold
|
||||
Coldark-Dark
|
||||
DarkNeon
|
||||
Dracula
|
||||
Monokai Extended
|
||||
Monokai Extended Bright
|
||||
Monokai Extended Origin
|
||||
Nord
|
||||
OneHalfDark
|
||||
Solarized (dark)
|
||||
Sublime Snazzy
|
||||
TwoDark
|
||||
Visual Studio Dark+
|
||||
ansi
|
||||
base16
|
||||
base16-256
|
||||
gruvbox-dark
|
||||
zenburn
|
||||
```
|
||||
|
||||
### Light Syntax Themes
|
||||
|
||||
```txt
|
||||
GitHub
|
||||
Monokai Extended Light
|
||||
OneHalfLight
|
||||
Solarized (light)
|
||||
gruvbox-light
|
||||
```
|
||||
|
||||
## How to manually configure git to use delta
|
||||
|
||||
You can use `git config --global` to get or set any arbitrary option of
|
||||
`~/.gitconfig`.
|
||||
|
||||
```bash
|
||||
git config --global page.diff delta
|
||||
git config --global page.show delta
|
||||
git config --global page.log delta
|
||||
git config --global page.blame delta
|
||||
git config --global page.reflog delta
|
||||
|
||||
git config --global interactive.diffFilter 'delta --color-only'
|
||||
|
||||
git config delta.syntax-theme 'Coldark-Dark'
|
||||
```
|
||||
|
||||
Your `~/.gitconfig` will then contain these sections and options:
|
||||
|
||||
```gitconfig
|
||||
[pager]
|
||||
@@ -22,6 +132,7 @@ Install delta and add this to your `~/.gitconfig`:
|
||||
|
||||
[interactive]
|
||||
diffFilter = delta --color-only
|
||||
```
|
||||
|
||||
Make sure to check out the helpful [ReadMe](https://github.com/dandavison/delta/blob/master/README.md)
|
||||
[delta]
|
||||
syntax-theme = Coldark-Dark
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user