From 5b042fc3eaae1f580dd6441e031e89d6a8d1f6a0 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Fri, 27 Sep 2024 03:51:33 -0400 Subject: Evolve toggling section of manual --- .../src/tips-and-tricks/toggling-delta-features.md | 23 ++++++++++++++++++++-- 1 file 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 +``` -- cgit v1.2.3