diff options
| author | Dan Davison <dandavison7@gmail.com> | 2024-09-27 03:51:33 -0400 |
|---|---|---|
| committer | Dan Davison <dandavison7@gmail.com> | 2024-09-27 04:00:47 -0400 |
| commit | 5b042fc3eaae1f580dd6441e031e89d6a8d1f6a0 (patch) | |
| tree | c0791483798077da21139a52534e8b9dc6d57de5 | |
| parent | 0dd38d43f7db12a4131f64b59bb5f826e07d75fc (diff) | |
Evolve toggling section of manual
| -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 +``` |
