diff options
| -rw-r--r-- | manual/src/tips-and-tricks/toggling-delta-features.md | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/manual/src/tips-and-tricks/toggling-delta-features.md b/manual/src/tips-and-tricks/toggling-delta-features.md index 5bca1d7..4091b62 100644 --- a/manual/src/tips-and-tricks/toggling-delta-features.md +++ b/manual/src/tips-and-tricks/toggling-delta-features.md @@ -1,4 +1,16 @@ -To toggle features such as `side-by-side` on and off, one solution is to use this shell function: +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: + +```sh +export DELTA_FEATURES=+side-by-side +``` + +and to undo that: + +```sh +export DELTA_FEATURES=+ +``` + +To make that convenient, you could use this shell function: ```sh delta-toggle() { @@ -17,4 +29,11 @@ delta-toggle s # toggles side-by-side delta-toggle l # toggles line-numbers ``` -(It might make sense to add something like this Python script to `delta` itself.)
\ No newline at end of file +(It might make sense to add something like this Python script to `delta` itself.) + +Another approach is to use git aliases, e.g. + +```gitconfig +[alias] + diff-side-by-side = -c delta.features=side-by-side diff +``` |
