| 1 | To toggle features such as `side-by-side` on and off, you need to *not* turn on `line-numbers` or `side-by-side` etc in your main delta config (`~/.gitconfig`). Then, one approach is to use the [`DELTA_FEATURES](../features-named-groups-of-settings.md)` environment variable: |
| 2 | |
| 3 | ```sh |
| 4 | export DELTA_FEATURES=+side-by-side |
| 5 | ``` |
| 6 | |
| 7 | and to undo that: |
| 8 | |
| 9 | ```sh |
| 10 | export DELTA_FEATURES=+ |
| 11 | ``` |
| 12 | |
| 13 | To make that convenient, you could use this shell function: |
| 14 | |
| 15 | ```sh |
| 16 | delta-toggle() { |
| 17 | eval "export DELTA_FEATURES='$(-delta-features-toggle $1 | tee /dev/stderr)'" |
| 18 | } |
| 19 | ``` |
| 20 | where `-delta-features-toggle` is this Python script: |
| 21 | [https://github.com/dandavison/tools/blob/main/python/-delta-features-toggle](https://github.com/dandavison/tools/blob/main/python/-delta-features-toggle). |
| 22 | |
| 23 | |
| 24 | Then |
| 25 | |
| 26 | ``` |
| 27 | delta-toggle # shows current features |
| 28 | delta-toggle s # toggles side-by-side |
| 29 | delta-toggle l # toggles line-numbers |
| 30 | ``` |
| 31 | |
| 32 | (It might make sense to add something like this Python script to `delta` itself.) |
| 33 | |
| 34 | Another approach is to use git aliases, e.g. |
| 35 | |
| 36 | ```gitconfig |
| 37 | [alias] |
| 38 | diff-side-by-side = -c delta.features=side-by-side diff |
| 39 | ``` |