From 5a85254bdec009ab7be5a1b2d1376e809f172a8b Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sun, 30 Jun 2024 15:41:44 +0900 Subject: [PATCH] docs: add customization example of color-words diff style 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. --- CHANGELOG.md | 3 +++ docs/config.md | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75e5c63a7..b28c2fffe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ` 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)'`. diff --git a/docs/config.md b/docs/config.md index d75a5de94..72411f0d0 100644 --- a/docs/config.md +++ b/docs/config.md @@ -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