Skip to content

Commit

Permalink
Add a manual entry for toggling side-by-side
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Jul 8, 2024
1 parent 716fa79 commit 0d7c5af
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions manual/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- [Git blame](./git-blame.md)
- [Supported languages and themes](./supported-languages-and-themes.md)
- [Tips & tricks](./tips-and-tricks.md)
- [Toggling side-by-side and other delta features](./tips-and-tricks/toggling-delta-features.md)
- [24 bit color (truecolor)](./tips-and-tricks/24-bit-color-truecolor.md)
- [Mouse scrolling](./tips-and-tricks/mouse-scrolling.md)
- [Save output with colors to HTML/PDF etc](./tips-and-tricks/export-to-html.md)
Expand Down
20 changes: 20 additions & 0 deletions manual/src/tips-and-tricks/toggling-delta-features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
To toggle features such as `side-by-side` on and off, one solution is to use this shell function:

```sh
delta-toggle() {
eval "export DELTA_FEATURES=$(-delta-features-toggle $1 | tee /dev/stderr)"
}
```
where `-delta-features-toggle` is this Python script:
[https://github.com/dandavison/tools/blob/main/python/-delta-features-toggle](https://github.com/dandavison/tools/blob/main/python/-delta-features-toggle).


Then

```
delta-toggle # shows current features
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.)

0 comments on commit 0d7c5af

Please sign in to comment.