-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a manual entry for toggling side-by-side
- Loading branch information
1 parent
716fa79
commit 0d7c5af
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.) |