diff options
author | Dan Davison <dandavison7@gmail.com> | 2019-09-17 12:51:37 +0100 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2019-09-19 14:46:43 +0100 |
commit | 9fff322822ef168f71ace23bd60f8be6c90f0026 (patch) | |
tree | 8e481f4bdce5f4eb08f6fd63f9f7dd193e6bbfdb /README.md | |
parent | 7c4d447359347e9d19a17b5ab9b1cec004dca976 (diff) |
Update README
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 149 |
1 files changed, 111 insertions, 38 deletions
@@ -2,55 +2,43 @@ ## A syntax-highlighting pager for git -<table> - <tr> - <td> - <img width=500px style="border: 1px solid black" - src="https://user-images.githubusercontent.com/52205/61316245-8fd95f80-a7ce-11e9-9a26-607eefbeed45.png" - alt="image" /> - </td> - <td> - <img width=500px style="border: 1px solid black" - src="https://user-images.githubusercontent.com/52205/61316175-602a5780-a7ce-11e9-87a6-05ffa09c7475.png" - alt="image" /> - </td> - </tr> - <tr> - <td> - delta --dark (default) - </td> - <td> - delta --light - </td> - </tr> -</table> +Delta brings language syntax highlighting, within-line insertion/deletion detection, and restructured diff output to git on the command line. Here's an example of `git show` output with git configured to use delta as its pager: -<br> +<img width=800px src="https://user-images.githubusercontent.com/52205/65245123-e8392000-dae3-11e9-88ef-fcccf6ade952.png" alt="image" /> + + +## Features +| | delta | git | diff-so-fancy | github/gitlab | +|------------------------------------------------|-------|-----|---------------|---------------| +| language syntax highlighting | ✅ | ❌ | ❌ | ✅ | +| within-line insertion/deletion detection | ✅ | ❌ | ✅ | ✅ | +| multiple insertion/deletions detected per line | ✅ | ❌ | ❌ | ✅ | +| matching of unequal numbers of changed lines | ✅ | ❌ | ❌ | ❌ | ## Installation -Executables: [Linux](https://github.com/dandavison/delta/releases/download/0.0.9/delta-0.0.9-x86_64-unknown-linux-musl.tar.gz) | [MacOS](https://github.com/dandavison/delta/releases/download/0.0.9/delta-0.0.9-x86_64-apple-darwin.tar.gz) +Executables: [Linux](https://github.com/dandavison/delta/releases/download/0.0.9/delta-0.0.9-x86_64-unknown-linux-musl.tar.gz) | [MacOS](https://github.com/dandavison/delta/releases/download/0.0.9/delta-0.0.9-x86_64-apple-darwin.tar.gz) | [All](https://github.com/dandavison/delta/releases) Homebrew: ```sh brew tap dandavison/delta https://github.com/dandavison/delta brew install dandavison/delta/git-delta +... +brew upgrade git-delta ``` -All available executables: https://github.com/dandavison/delta/releases -<br> -## Configure git to use delta +#### Configure git to use delta ```sh git config --global core.pager "delta --dark" # --light for light terminal backgrounds ``` -Alternatively, you can edit your `.gitconfig` directly. An example is +Alternatively, you can edit your `.gitconfig` directly. Delta accepts many command line options to alter colors and other details of the output. An example is ``` [core] - pager = delta --plus-color="#012800" --minus-color="#340001" --theme="base16-ocean.dark" + pager = delta --dark --plus-color="#012800" --minus-color="#340001" --theme="base16-ocean.dark" ``` All git commands that display diff output should now display syntax-highlighted output. For example: @@ -62,7 +50,54 @@ All git commands that display diff output should now display syntax-highlighted <br> -## Usage + +<br> + +<table> + <tr> + <td> + delta --dark (default) + </td> + <td> + delta --light + </td> + </tr> + <tr> + <td> + <img width=500px style="border: 1px solid black" + src="https://user-images.githubusercontent.com/52205/65245970-85488880-dae5-11e9-9fd2-d358071bcf7f.png" + alt="image" /> + </td> + <td> + <img width=500px style="border: 1px solid black" + src="https://user-images.githubusercontent.com/52205/65246093-c93b8d80-dae5-11e9-8346-eb8bc0a89e75.png" + alt="image" /> + </td> + </tr> +</table> + +<br> + + +## Supported languages and themes +Delta supports the same languages and themes as [bat](https://github.com/sharkdp/bat), included here as the files `assets/syntaxes.bin` and `assets/themes.bin`. Please see the [bat](https://github.com/sharkdp/bat) documentation for instructions on how to create new versions of these files. + + +## 24 bit color + +Delta works best if your terminal application supports 24 bit colors. See https://gist.github.com/XVilka/8346728. For example, on MacOS, iTerm2 works but Terminal.app does not. + +If you're using tmux, it's worth checking that 24 bit color is working correctly. For example, run a color test script like [this one](https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh), or one of the others listed [here](https://gist.github.com/XVilka/8346728). If you do not see smooth color gradients, see the discussion at [tmux#696](https://github.com/tmux/tmux/issues/696). The short version is you need something like this in your `~/.tmux.conf`: +``` +set -ga terminal-overrides ",xterm-256color:Tc" +``` +and you may then need to quit tmux completely for it to take effect. + +<br> + +## Options +Here's the output of `delta --help`. To use these options, add them to the delta command line in your `.gitconfig` file. + ``` USAGE: delta [FLAGS] [OPTIONS] @@ -114,17 +149,55 @@ OPTIONS: <br> -## 24 bit color - delta works best if your terminal application supports 24 bit colors. See https://gist.github.com/XVilka/8346728. For example, on MacOS, iTerm2 works but Terminal.app does not. +## Comparisons + +<table> + <tr> + <td> + Delta + </td> + <td> + <img width=500px style="border: 1px solid black" + src="https://user-images.githubusercontent.com/52205/65248525-32250480-daea-11e9-9965-1a05c6a4bdf4.png" + alt="image" /> + </td> + </tr> + <tr> + <td> + Diff-so-fancy + </td> + <td> + <img width=500px style="border: 1px solid black" + src="https://user-images.githubusercontent.com/52205/65248407-07d34700-daea-11e9-9a8f-6d81f4021abf.png" + alt="image" /> + </td> + </tr> + <tr> + <td> + Git + </td> + <td> + <img width=500px style="border: 1px solid black" + src="https://user-images.githubusercontent.com/52205/65248441-14f03600-daea-11e9-88a1-d96bbb6947f8.png" + alt="image" /> + </td> + </tr> + <tr> + <td> + Github + </td> + <td> + <img width=500px style="border: 1px solid black" + src="https://user-images.githubusercontent.com/52205/65248749-9a73e600-daea-11e9-9c0d-29c8f1dea08e.png" + alt="image" /> + </td> + </tr> +</table> + + - If you're using tmux, it's worth checking that 24 bit color is working correctly. For example, run a color test script like [this one](https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh), or one of the others listed [here](https://gist.github.com/XVilka/8346728). If you do not see smooth color gradients, see the discussion at [tmux#696](https://github.com/tmux/tmux/issues/696). The short version is you need something like this in your `~/.tmux.conf`: - ``` - set -ga terminal-overrides ",xterm-256color:Tc" - ``` - and you may then need to quit tmux completely for it to take effect. -<br> ## Credit https://github.com/trishume/syntect<br> |