Skip to content

Commit

Permalink
docs: add customization example of color-words diff style
Browse files Browse the repository at this point in the history
The default style is compatible with various terminal emulators, but I suspect
that many people wouldn't like underlines. Let's add an example to override it.
  • Loading branch information
yuja committed Jul 2, 2024
1 parent 3bca159 commit 5a85254
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* New diff option `jj diff --name-only` allows for easier shell scripting.

* In color-words diffs, hunks are now highlighted with underline. See [diff
colors and styles](docs/config.md#diff-colors-and-styles) for customization.

* `jj git push -c <arg>` can now accept revsets that resolve to multiple
revisions. This means that `jj git push -c xyz -c abc` is now equivalent to
`jj git push -c 'all:(xyz | abc)'`.
Expand Down
12 changes: 12 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ useful reminder to fill in things like BUG=, TESTED= etc.
ui.default-description = "\n\nTESTED=TODO"
```

### Diff colors and styles

In color-words diffs, hunks are rendered with underline. You can override the
default style with the following keys:

```toml
[colors]
# Highlight hunks with background
"diff removed token" = { bg = "#221111", underline = false }
"diff added token" = { bg = "#002200", underline = false }
```

### Diff format

```toml
Expand Down

0 comments on commit 5a85254

Please sign in to comment.