0.10.0
New features in this release:
- delta displays output from
git grep
andrg --json ... | delta
with code syntax highlighting and navigate functionality. See README#grep and #774. - delta displays output from
git blame
with code syntax highlighting, hyperlinks to commits, and control over formatting. See README#git-blame and #761. - delta syntax highlights file contents produced by
git show $revision:/path/to/file
- delta can apply syntax highlighting and arbitrary styling to the raw colors emitted by
git --color-moved
. This is done by specifying rules for remapping styles usingmap-styles
. See below, and README#--color-moved-support and #72 - More powerful configuration options: styles can reference other styles, custom styles and custom colors can be defined in gitconfig and reused, and 140 colors can be specified using their standard CSS names. See below.
- New subcommand
--show-colors
outputs a demo of 140 background colors with syntax highlighting, to help choose background colors. - New subcommand
--parse-ansi
takes color input and prints out the corresponding style strings (useful formap-styles
) - Utilities for interrogating the command line of the process that is sending output to delta, added by @th1000s.
Here's an example of using map-styles
to assign delta styles (one with syntax highlighting) to the raw color-moved styles output by git. This should allow all git's color-moved options to be rendered using delta styles:
[delta]
features = my-color-moved-theme
[delta "my-color-moved-theme"]
git-moved-from-style = bold purple # An ad-hoc named style (must end in "-style")
map-styles = "my-color-moved-theme.git-moved-from-style => red #cccccc, \
bold cyan => syntax #cccccc"
# we could also have defined git-moved-to-style = bold cyan
To make use of that, you need to know that git is emitting "bold cyan" and "bold purple". But that's not always obvious. To help with that, delta now has a --parse-ansi
mode. E.g. git show --color=always | delta --parse-ansi
outputs something like this:
As you see above, we can now define named styles in gitconfig and refer to them in places where a style string is expected. We can also define custom named colors in git config, and styles can reference other styles; see the hoopoe theme for an example:
[delta "hoopoe"]
green = "#d0ffd0" # ad-hoc named color
plus-style = syntax hoopoe.green # refer to named color
plus-non-emph-style = plus-style # styles can reference other styles
Additionally, we can now use the 140 color names that are standard in CSS. Use delta --show-colors
to get a demo of the available colors, as background colors to see how they look with syntax highlighting:
PRs
- Util: check parent process for filename by @th1000s in #770
- Handle git blame by @dandavison in #761
- Use modify label on diffs & add right-arrow option by @WayneD in #780
- Allow styles to be specified as references to other styles by @dandavison in #784
- Support named colors by @dandavison in #786
- Handle grep output by @dandavison in #774
- Allow custom colors to be defined in gitconfig by @dandavison in #788
- --show-colors subcommand by @dandavison in #789
- Navigate regexp by @WayneD in #782
- Map styles for arbitrary color-moved styling, --parse-ansi subcommand by @dandavison in #793
New Contributors
Full Changelog: 0.9.2...0.10.0