DELTA(1)
π DELTA(1) π
User Commands Β· section 1 Β· the pager that makes your diffs look edible, fr fr π
π NAME
delta β syntax-highlighting pager for git, diff, and grep output
Bestie, it's not just a pager. It's the pager. It takes your crusty raw diff and gives it main character energy. β¨
π¦ SYNOPSIS
delta [OPTIONS] [MINUS_FILE] [PLUS_FILE]
π DESCRIPTION
A viewer for git and diff output. That's it, that's the whole vibe. π
πΈ Arguments:
[MINUS_FILE]β the first file to be compared when delta is being used to diff two files.
So like, delta file1 file2 is equivalent to diff -u file1 file2 | delta. Same energy, less typing. π
[PLUS_FILE]β the second file to be compared when delta is being used to diff two files.
Two files in, pretty diff out. Periodt. π«Ά
β¨ OPTIONS β¨
Okay so this is the long part. Grab a snack, hydrate, we're going through every single one. π§
--blame-code-style <STYLE>β style string for the code section of a git blame line.
By default the code will be syntax-highlighted with the same background color as the blame format section of the line (the background color is determined by blame-palette). E.g. setting this option to 'syntax' will syntax-highlight the code with no background color.
--blame-format <FMT>β format string for git blame commit metadata.
Available placeholders are "{timestamp}", "{author}", and "{commit}".
[default: "{timestamp:<15} {author:<15.14} {commit:<8}"]
--blame-palette <COLORS>β background colors used for git blame lines (space-separated string).
Lines added by the same commit are painted with the same color; colors are recycled as needed. So yeah, commit besties get matching fits. π¨
--blame-separator-format <FMT>β separator between the blame format and the code section of a git blame line.
Contains the line number by default. Possible values are "none" to disable line numbers or a format string. This may contain one "{n:}" placeholder and will display the line number on every line. A type may be added after all other format specifiers and can be separated by '_': If type is set to 'block' (e.g. "{n:^4_block}") the line number will only be shown when a new blame block starts; or if it is set to 'every-N' the line will be show with every block and every N-th (modulo) line.
[default: ???{n:^4}???]
--blame-separator-style <STYLE>β style string for theblame-separator-format.--blame-timestamp-format <FMT>β format ofgit blametimestamp in raw git output received by delta.
[default: "%Y-%m-%d %H:%M:%S %z"]
--blame-timestamp-output-format <FMT>β format string for git blame timestamp output.
This string is used for formatting the timestamps in git blame output. It must follow the strftime format syntax specification. If it is not present, the timestamps will be formatted in a human-friendly but possibly less accurate form.
See: https://docs.rs/chrono/latest/chrono/format/strftime/index.html
--color-onlyβ do not alter the input structurally in any way.
But color and highlight hunk lines according to your delta configuration. This is mainly intended for other tools that use delta.
--config <PATH>β load the config file at PATH instead of~/.gitconfig.
[default: ""]
--commit-decoration-style <STYLE>β style string for the commit hash decoration.
See STYLES section. The style string should contain one of the special attributes 'box', 'ul' (underline), 'ol' (overline), or the combination 'ul ol'.
[default: ""]
--commit-regex <REGEX>β regular expression used to identify the commit line when parsing git output.
[default: "^commit "]
--commit-style <STYLE>β style string for the commit hash line.
See STYLES section. The style 'omit' can be used to remove the commit hash line from the output.
[default: raw]
--darkβ use default colors appropriate for a dark terminal background.
For more control, see the style options and --syntax-theme.
--default-language <LANG>β default language used for syntax highlighting.
Used as a fallback when the language cannot be inferred from a filename. It will typically make sense to set this in the per-repository config file '.git/config'.
[default: txt]
--detect-dark-light <DETECT_DARK_LIGHT>β detect whether or not the terminal is dark or light by querying for its colors.
Ignored if either --dark or --light is specified.
Querying the terminal for its colors requires "exclusive" access since delta reads/writes from the terminal and enables/disables raw mode. This causes race conditions with pagers such as less when they are attached to the same terminal as delta.
This is usually only an issue when the output is manually piped to a pager. For example: git diff | delta | less. Otherwise, if delta starts the pager itself, then there's no race condition since the pager is started after the color is detected.
auto tries to account for these situations by testing if the output is redirected.
The --color-only option is treated as an indicator that delta is used as interactive.diffFilter. In this case the color is queried from the terminal even though the output is redirected.
Possible values:
auto: Only query the terminal for its colors if the output is not redirectedalways: Always query the terminal for its colorsnever: Never query the terminal for its colors
[default: auto]
-@,--diff-args <STRING>β extra arguments to pass togit diffwhen using delta to diff two files.
E.g. delta --diff-args=-U999 file_1 file_2 is equivalent to git diff --no-index --color -U999 file_1 file_2 | delta.
If you use process substitution (delta <(command_1) <(command_2)) and your git version doesn't support it, then delta will fall back to diff instead of git diff.
[default: ""]
--diff-highlightβ emulate diff-highlight.
https://github.com/git/git/tree/master/contrib/diff-highlight
--diff-so-fancyβ emulate diff-so-fancy.
https://github.com/so-fancy/diff-so-fancy
--diff-stat-align-width <N>β width allocated for file paths in a diff stat section.
If a relativized file path exceeds this width then the diff stat will be misaligned.
[default: 48]
--features <FEATURES>β names of delta features to activate (space-separated).
A feature is a named collection of delta options in ~/.gitconfig. See FEATURES section. The environment variable DELTA_FEATURES can be set to a space-separated list of feature names. If this is preceded with a + character, the features from the environment variable will be added to those specified in git config. E.g. DELTA_FEATURES=+side-by-side can be used to activate side-by-side temporarily (use DELTA_FEATURES=+ to go back to just the features from git config).
--file-added-label <STRING>β text to display before an added file path.
Used in the default value of navigate-regex.
[default: added:]
--file-copied-label <STRING>β text to display before a copied file path.
[default: copied:]
--file-decoration-style <STYLE>β style string for the file decoration.
See STYLES section. The style string should contain one of the special attributes 'box', 'ul' (underline), 'ol' (overline), or the combination 'ul ol'.
[default: "blue ul"]
--file-modified-label <STRING>β text to display before a modified file path.
Used in the default value of navigate-regex.
[default: ""]
--file-removed-label <STRING>β text to display before a removed file path.
Used in the default value of navigate-regex.
[default: removed:]
--file-renamed-label <STRING>β text to display before a renamed file path.
Used in the default value of navigate-regex.
[default: renamed:]
--file-style <STYLE>β style string for the file section.
See STYLES section. The style 'omit' can be used to remove the file section from the output.
[default: blue]
--file-transformation <SED_CMD>β sed-style command transforming file paths for display.--generate-completion <GENERATE_COMPLETION>β print completion file for the given shell.
[possible values: bash, elvish, fish, powershell, zsh]
Not me generating tab-completion for every shell under the sun. Iconic behavior. π
--grep-context-line-style <STYLE>β style string for non-matching lines of grep output.
See STYLES section. Defaults to zero-style.
--grep-file-style <STYLE>β style string for file paths in grep output.
See STYLES section.
[default: magenta]
--grep-header-decoration-style <STYLE>β style string for the header decoration in grep output.
Default is "none" when grep-output-type-is "ripgrep", otherwise defaults to value of header-decoration-style. See hunk-header-decoration-style.
--grep-header-file-style <STYLE>β style string for the file path part of the header in grep output.
See hunk_header_file_style.
--grep-line-number-style <STYLE>β style string for line numbers in grep output.
See STYLES section.
[default: green]
--grep-output-type <OUTPUT_TYPE>β grep output format.
Possible values:
"ripgrep"β file name printed once, followed by matching lines within that file, each preceded by a line number."classic"β file name:line number, followed by matching line.
Default is "ripgrep" if rg --json format is detected, otherwise "classic".
[possible values: ripgrep, classic]
--grep-match-line-style <STYLE>β style string for matching lines of grep output.
See STYLES section. Defaults to plus-style.
--grep-match-word-style <STYLE>β style string for the matching substrings within a matching line of grep output.
See STYLES section. Defaults to plus-style.
--grep-separator-symbol <STRING>β separator symbol printed after the file path and line number in grep output.
Defaults to ":" for both match and context lines, since many terminal emulators recognize constructs like "/path/to/file:7:". However, standard grep output uses "-" for context lines: set this option to "keep" to keep the original separator symbols.
[default: :] (yes bestie this is the tail end of the option right above β every default is sacred, no skipping β¨)
--hunk-header-decoration-style <STYLE>β this one styles the decoration around the hunk header, like the little box or lines framing it π Check the STYLES section for the deets. Your style string should have one of the special attributesbox,ul(underline),ol(overline), or the comboul ol. [default: "blue box"]--hunk-header-file-style <STYLE>β style string for the file path part of the hunk header π¦ Go look at STYLES. Heads up tho: the file path only shows up ifhunk-header-stylecontains thefilespecial attribute. [default: blue]--hunk-header-line-number-style <STYLE>β style string for the line number part of the hunk header β Again, STYLES section is your friend. And the line number only shows up ifhunk-header-stylecontains theline-numberspecial attribute. [default: blue]--hunk-header-style <STYLE>β style string for the whole hunk header π See STYLES. The special attributesfileandline-numberlet you pull in the file path and the number of the first hunk line into the hunk header. And if you use the styleomit, the hunk header section gets yeeted out of the output entirely. [default: "line-number syntax"]--hunk-label <STRING>β the text to display before a hunk header π¬ It's used in the default value ofnavigate-regex. [default: ""]--hyperlinksβ makes commit hashes, file names, and line numbers render as hyperlinks π fr fr. It follows the hyperlink spec for terminal emulators:https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda. By default, file names and line numbers link to the local file using a file URL, while commit hashes link to the commit on GitHub β but only if the remote repo is hosted by GitHub. Wanna full control over the file URLs that get emitted? That's--hyperlinks-file-link-format. Several common terminal emulators support hyperlinks. But to actually make them work you must uselessversion>= 581with the-Rflag (or-rwith olderlessversions β tho that will break e.g.--navigateπ). And if you're ontmux, you'll also need a patched fork of tmux (peephttps://github.com/dandavison/tmux).--hyperlinks-commit-link-format <FMT>β format string for commit hyperlinks (requires--hyperlinks). The{commit}placeholder gets swapped for the commit hash π For example:--hyperlinks-commit-link-format='https://mygitrepo/{commit}/'--hyperlinks-file-link-format <FMT>β format string for file hyperlinks (requires--hyperlinks). The placeholders{path}and{line}get replaced by the absolute file path and the line number;{host}gets replaced with the hostname delta is currently running on πΈ The default is to create a hyperlink containing a standard file URI with only the filename, which your terminal or OS should handle. You can specify any scheme, like"file-line://{path}:{line}"and then register an application to handle it. Seehttps://dandavison.github.io/delta/hyperlinks.htmlfor the details. [default:file://{path}]--inline-hint-style <STYLE>β style string for short inline hint text β¨ This styles certain content that delta adds to the original diff, like the special characters that highlight tabs, and the symbols used to show wrapped lines. Check the STYLES section. [default: blue]--inspect-raw-lines <true|false>β the kill-switch for--color-movedsupport π It controls whether delta examines ANSI color escape sequences in the raw lines it gets from Git and handles lines colored in certain ways specially. This is on by default β it's literally how Delta supports Git's--color-movedfeature. Set it to"false"to disable this behavior. [default: true] [possible values: true, false]--keep-plus-minus-markersβ prefixes added/removed lines with a+/-character, exactly like git does π By default delta emits no prefix, so you can copy code straight out of delta's output. (Iconic behavior honestly.)--lightβ uses default colors that are appropriate for a light terminal background βπ Want more control? Go check the style options and--syntax-theme.--line-buffer-size <N>β the size of delta's internal line buffer π§Ί Delta compares the added and removed versions of nearby lines so it can detect and highlight changes at the level of individual words/tokens. Which means nearby lines have to be buffered internally before they get painted and emitted. Bumping this value up might improve highlighting of some large diff hunks. But beware: setting it high will adversely affect delta's performance when entire files are added/removed π¬ [default: 32]--line-fill-method <STRING>β the line-fill method in side-by-side mode ποΈ It decides how the background color gets extended to the end of the line in side-by-side mode. Can beansi(default) orspaces(which is the default if output is not going to a terminal). Has zero effect if--width=variableis given. [possible values: ansi, spaces]-n,--line-numbersβ displays line numbers next to the diff π’ See the LINE NUMBERS section for the whole story.--line-numbers-left-format <FMT>β format string for the left column of line numbers π A typical value would be"{nm:^4}???"which means: display the line numbers of the minus file (old version), center-aligned, padded to a width of 4 characters, followed by a dividing character. See the LINE NUMBERS section. [default: {nm:^4}???]--line-numbers-left-style <STYLE>β style string for the left column of line numbers π See the STYLES and LINE NUMBERS sections. [default: auto]--line-numbers-minus-style <STYLE>β style string for line numbers in the old (minus) version of the file π See STYLES and LINE NUMBERS. [default: auto]--line-numbers-plus-style <STYLE>β style string for line numbers in the new (plus) version of the file π See STYLES and LINE NUMBERS. [default: auto]--line-numbers-right-format <FMT>β format string for the right column of line numbers π¦ A typical value would be"{np:^4}??? "which means: display the line numbers of the plus file (new version), center-aligned, padded to a width of 4 characters, followed by a dividing character, and a space. See the LINE NUMBERS section. [default: {np:^4}???]--line-numbers-right-style <STYLE>β style string for the right column of line numbers β See STYLES and LINE NUMBERS. [default: auto]--line-numbers-zero-style <STYLE>β style string for line numbers in unchanged (zero) lines π See STYLES and LINE NUMBERS. [default: auto]--list-languagesβ lists supported languages and the file extensions associated with them πβ¨--list-syntax-themesβ lists all the available syntax-highlighting color themes π¨π--map-styles <STYLES_MAP>β maps styles encountered in raw input to the output styles you actually want π« An example is--map-styles='bold purple => red "#eeeeee", bold cyan => syntax "#eeeeee"'--max-line-distance <DIST>β the maximum line pair distance parameter in the within-line diff algorithm π This parameter is the maximum distance (0.0-1.0) between two lines for them to be inferred to be homologous. Homologous line pairs get highlighted according to the deletion and insertion operations that transform one into the other. [default: 0.6]--max-syntax-highlighting-length <N>β stops syntax highlighting lines after this many characters βοΈ To always highlight entire lines, set it to zero β but bestie, be warned: delta will be slow on very long lines (e.g. minified.js) π [default: 400]--max-line-length <N>β truncates lines longer than this π« If you want absolutely no truncation, set it to zero. When wrapping lines this does nothing, because it gets overwritten to fit at least all visible characters β see--wrap-max-lines. [default: 3000]--merge-conflict-begin-symbol <STRING>β the string marking the beginning of a merge conflict region π© The string will be repeated until it reaches the required length. [default: ???]--merge-conflict-end-symbol <STRING>β the string marking the end of a merge conflict region π The string will be repeated until it reaches the required length. [default: ???]--merge-conflict-ours-diff-header-decoration-style <STYLE>β style string for the decoration of the header above the 'ours' merge conflict diff π This styles the decoration of the header above the diff between the ancestral commit and the'ours'branch. See the STYLES section. The style string should contain one of the special attributesbox,ul(underline),ol(overline), or the combinationul ol. [default: box]--merge-conflict-ours-diff-header-style <STYLE>β style string for the header above the'ours'branch merge conflict diff π See the STYLES section. [default: normal]--merge-conflict-theirs-diff-header-decoration-style <STYLE>β style string for the decoration of the header above the 'theirs' merge conflict diff π¦ This styles the decoration of the header above the diff between the ancestral commit and'their'branch. See the STYLES section. The style string should contain one of the special attributesbox,ul(underline),ol(overline), or the combinationul ol. [default: box]--merge-conflict-theirs-diff-header-style <STYLE>β style string for the header above the'theirs'branch merge conflict diff πΈ This styles the header above the diff between the ancestral commit and'their'branch. See the STYLES section. [default: normal]--minus-empty-line-marker-style <STYLE>β style string for the removed empty line marker π It's used only if--minus-stylehas no background color. [default: "normal auto"]--minus-emph-style <STYLE>β style string for the emphasized sections of removed lines β¨ See the STYLES section. [default: "normal auto"]--minus-non-emph-style <STYLE>β style string for the non-emphasized sections of removed lines that have an emphasized section π See the STYLES section.
oh and the default for that last one? It's minus-style π
moving right along.
--minus-style <STYLE>β the style string for removed lines π©Έ. Peep the STYLES section for how these work.
Default: "normal auto"
--navigateβ turns on diff navigation β¨. Hitnto jump forwards andNto jump backwards. Wanna change the file labels it uses? Go see--file-added-label,--file-copied-label,--file-modified-label,--file-removed-label, and--file-renamed-label.--navigate-regex <REGEX>β a regular expression that defines the navigation stop points.--no-gitconfigβ reads zero settings from git config π ββοΈ. Hit up the GIT CONFIG section if you're nosy.--pager <CMD>β which pager to use. The default pager isless. You can also switch your pager by setting theDELTA_PAGERenvironment variable, orPAGER. This option overrides those environment variables though β it said what it said. π--paging <auto|always|never>β whether to use a pager when displaying output. The options are:auto,always, andnever.
Default: auto. Possible values: auto, always, never.
--parse-ansiβ displays ANSI color escape sequences in human-readable form π. Example usage:git show --color=always | delta --parse-ansi. This is lowkey perfect for figuring out which input style strings to use withmap-styles.--plus-emph-style <STYLE>β the style string for the emphasized sections of added lines β¨. See the STYLES section.
Default: "syntax auto"
--plus-empty-line-marker-style <STYLE>β the style string for the added empty line marker. It's only used if--plus-stylehas no background color, fyi.
Default: "normal auto"
--plus-non-emph-style <STYLE>β the style string for non-emphasized sections of added lines that have an emphasized section. See the STYLES section.
Default: plus-style
--plus-style <STYLE>β the style string for added lines π. See the STYLES section.
Default: "syntax auto"
--rawβ does not alter the input in any way. This is mainly intended for testing delta π§ͺ.--relative-pathsβ outputs all file paths relative to the current directory π«Ά. Which means they'll actually resolve correctly when you click on them or use them in shell commands. adore.--right-arrow <STRING>β the text to display with a changed file path. Like, for a unified diff heading, a rename, or a chmod.
Default:
[default: "???
"]
--show-colorsβ shows the available named colors π¨. And on top of named colors, you can specify arbitrary colors using RGB hex codes. See the COLORS section.--show-configβ displays the active values for all Delta options π . Style string options get displayed with their foreground and background colors, which is perfect for experimenting with colors by combining this option with other options such as--minus-style,--zero-style,--plus-style,--light,--dark, etc.--show-syntax-themesβ shows an example diff for the available syntax-highlighting themes β¨. If diff output is supplied on standard input, then that's what gets used for the demo. For example:git show | delta --show-syntax-themes.--show-themesβ shows an example diff for the available delta themes π. A delta theme is a delta named feature (see--features) that sets eitherlightordark. See <https://github.com/dandavison/delta#custom-color-themes>. If diff output is supplied on standard input then that's what gets used for the demo. For example:git show | delta --show-themes. By default it shows dark or light themes only, according to whether delta is in dark or light mode (as set by the user or inferred fromBAT_THEME). To control the themes shown, use--darkor--light, or both, on the command line together with this option.-s,--side-by-sideβ displays diffs in side-by-side layout π―--syntax-theme <SYNTAX_THEME>β the syntax-highlighting theme to use. Use--show-syntax-themesto demo the available themes. It defaults to the value of theBAT_THEMEenvironment variable, if that contains a valid theme name. And--syntax-theme=nonedisables all syntax highlighting, periodt.--tabs <N>β the number of spaces to replace tab characters with. Use--tabs=0to pass tab characters through directly, but bestie, note that in that case delta will calculate line widths assuming tabs occupy one character's width on the screen: if your terminal renders tabs as more than one character wide then delta's output will look incorrect π.
Default: 8
--true-color <auto|always|never>β whether to emit 24-bit ("true color") RGB color codes π. The options areauto,always, andnever."auto"means delta will emit 24-bit color codes if the environment variableCOLORTERMhas the value"truecolor"or"24bit". If your terminal application (the application you use to enter commands at a shell prompt) supports 24 bit colors, then it probably already sets this environment variable, in which case you don't need to do anything π«Ά.
Default: auto. Possible values: auto, always, never.
--whitespace-error-style <STYLE>β the style string for whitespace errors. It defaults tocolor.diff.whitespaceif that's set in git config, or else'magenta reverse'.
Default: "auto auto"
-w,--width <N>β the width of underline/overline decorations π. Examples:"72"(exactly 72 characters),"-2"(auto-detected terminal width minus 2). An expression such as"74-2"is also valid (equivalent to 72 but may be useful if the caller has a variable holding the value"74"). Use--width=variableto extend decorations and background colors to the end of the text only. Otherwise background colors extend to the full terminal width.--word-diff-regex <REGEX>β the regular expression defining a 'word' in the within-line diff algorithm π€. This is the regex used to decide what a word is for the within-line highlight algorithm. For less fine-grained matching than the default, try--word-diff-regex="\S+"--max-line-distance=1.0(this is more similar togit --word-diff).
Default: \w+
--wrap-left-symbol <STRING>β end-of-line wrapped content symbol (left-aligned). It's the symbol added to the end of a line indicating that the content has been wrapped onto the next line and continues left-aligned.
Default: ???
--wrap-max-lines <N>β how often a line should be wrapped if it does not fit. Zero means to never wrap. Any content which does not fit after wrapping will be truncated. A value of"unlimited"means a line will be wrapped as many times as required.
Default: 2
--wrap-right-percent <PERCENT>β the threshold for right-aligning wrapped content. If the length of the remaining wrapped content, as a percentage of width, is less than this quantity, it'll be right-aligned. Otherwise it'll be left-aligned.
Default: 37.0
--wrap-right-prefix-symbol <STRING>β pre-wrapped content symbol (right-aligned). This is the symbol displayed before right-aligned wrapped content.
Default: ???
--wrap-right-symbol <STRING>β end-of-line wrapped content symbol (right-aligned). The symbol added to the end of a line indicating that the content has been wrapped onto the next line and continues right-aligned.
Default: ???
--zero-style <STYLE>β the style string for unchanged lines. See the STYLES section.
Default: "syntax normal"
--24-bit-color <auto|always|never>β Deprecated π: use--true-color.
Possible values: auto, always, never.
-h,--helpβ prints help (see a summary with-h).-V,--versionβ prints the version.
β¨ Git config β¨
By default, delta takes settings from a section named "delta" in git config files, if one is present π«Ά. The git config file used for delta options will usually be ~/.gitconfig, but delta follows the rules given in <https://git-scm.com/docs/git-config#FILES>. Most delta options can be given in a git config file, using the usual option names but without the initial --. An example is:
[delta]
line-numbers = true
zero-style = dim syntax
πΈ Features πΈ
A feature is a named collection of delta options in git config. An example is:
[delta "my-delta-feature"]
syntax-theme = Dracula
plus-style = bold syntax "#002800"
To activate those options, you would use:
delta --features my-delta-feature
A feature name may not contain whitespace. You can activate multiple features:
[delta]
features = my-highlight-styles-colors-feature my-line-number-styles-feature
If more than one feature sets the same option, the last one wins π.
If an option is present in the [delta] section, then features are not considered at all.
If you want an option to be fully overridable by a feature and also have a non default value when no features are used, then you need to define a "default" feature and include it in the main delta configuration.
For instance:
[delta]
feature = default-feature
[delta "default-feature"]
width = 123
At this point, you can override features set in the command line or in the environment variables and the "last one wins" rules will apply as expected.
π Styles π
All options that have a name like --*-style work the same way. It is very similar to how colors/styles are specified in a gitconfig file: <https://git-scm.com/docs/git-config#Documentation/git-config.txt-color>
Here is an example:
--minus-style 'red bold ul "#ffeeee"'
That means: for removed lines, set the foreground (text) color to 'red', make it bold and underlined, and set the background color to '#ffeeee' π.
See the Colors section below for how to specify a color. In addition to real colors, there are 4 special color names: 'auto', 'normal', 'raw', and 'syntax' β¨.
Here is an example of using special color names together with a single attribute:
--minus-style 'syntax bold auto'
That means: for removed lines, syntax-highlight the text, and make it bold, and do whatever delta normally does for the background. slay π
The available attributes are: blink, bold, dim, hidden, italic, reverse, strike, and ul (or underline β same thing bestie, pick your fave π«Ά).
The attribute omit is supported by commit-style, file-style, and hunk-header-style, and it literally just means: yeet the element entirely out of the output π. Gone. Not there. Periodt.
A complete description of the style string syntax follows:
- If the input that delta is receiving already has colors, and you want delta to output those colors unchanged, then use the special style string
raw. Otherwise, delta will strip any colors from its input. - A style string consists of 0, 1, or 2 colors, together with an arbitrary number of style attributes, all separated by spaces.
- The first color is the foreground (text) color. The second color is the background color. Attributes can go in any position.
- This means that in order to specify a background color you must also specify a foreground (text) color.
- If you want delta to choose one of the colors automatically, then use the special color
auto. This can be used for both foreground and background. - If you want the foreground/background color to be your terminal's foreground/background color, then use the special color
normal. - If you want the foreground text to be syntax-highlighted according to its language, then use the special foreground color
syntax. This can only be used for the foreground (text). - The minimal style specification is the empty string
''. This means: do not apply any colors or styling to the element in question.
π Colors π
There are four ways to specify a color (this section applies to foreground and background colors within a style string):
- CSS color name
Any of the 140 color names used in CSS: <https://www.w3schools.com/colors/colors_groups.asp>
- RGB hex code
An example of using an RGB hex code is: --file-style="#0e7c0e"
- ANSI color name
There are 8 ANSI color names: black, red, green, yellow, blue, magenta, cyan, white.
In addition, all of them have a bright form: brightblack, brightred, brightgreen, brightyellow, brightblue, brightmagenta, brightcyan, brightwhite.
An example of using an ANSI color name is: --file-style="green"
Unlike RGB hex codes, ANSI color names are just names: you can choose the exact color that each name corresponds to in the settings of your terminal application (the application you use to enter commands at a shell prompt). This means that if you use ANSI color names, and you change the color theme used by your terminal, then delta's colors will respond automatically, without needing to change the delta command line. that's the good stuff β¨
"purple" is accepted as a synonym for "magenta". Color names and codes are case-insensitive.
- ANSI color number
An example of using an ANSI color number is: --file-style=28
There are 256 ANSI color numbers: 0-255. The first 16 are the same as the colors described in the "ANSI color name" section above. See <https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit>. Specifying colors like this is useful if your terminal only supports 256 colors (i.e. doesn't support 24-bit color).
π’ Line Numbers π’
To display line numbers, use --line-numbers.
Line numbers are displayed in two columns. Here's what it looks like by default:
1 ???
1 ??? unchanged line
2 ??? ??? removed line
??? 2 ??? added line
In that output, the line numbers for the old (minus) version of the file appear in the left column, and the line numbers for the new (plus) version of the file appear in the right column. In an unchanged (zero) line, both columns contain a line number. cute right π
The following options allow the line number display to be customized:
--line-numbers-left-formatβ Change the contents of the left column--line-numbers-right-formatβ Change the contents of the right column--line-numbers-left-styleβ Change the style applied to the left column--line-numbers-right-styleβ Change the style applied to the right column--line-numbers-minus-styleβ Change the style applied to line numbers in minus lines--line-numbers-zero-styleβ Change the style applied to line numbers in unchanged lines--line-numbers-plus-styleβ Change the style applied to line numbers in plus lines
Options --line-numbers-left-format and --line-numbers-right-format allow you to change the contents of the line number columns. Their values are arbitrary format strings, which are allowed to contain the placeholders {nm} for the line number associated with the old version of the file and {np} for the line number associated with the new version of the file. The placeholders support a subset of the string formatting syntax documented here: <https://doc.rust-lang.org/std/fmt/#formatting-parameters>. Specifically, you can use the alignment and width syntax.
For example, the default value of --line-numbers-left-format is '{nm:^4}???'. This means that the left column should display the minus line number (nm), center-aligned, padded with spaces to a width of 4 characters, followed by a unicode dividing-line character (???).
Similarly, the default value of --line-numbers-right-format is '{np:^4}???'. This means that the right column should display the plus line number (np), center-aligned, padded with spaces to a width of 4 characters, followed by a unicode dividing-line character (???).
Use < for left-align, ^ for center-align, and > for right-align. main character energy for your columns, honestly π
π«Ά Support π«Ά
If something isn't working correctly, or you have a feature request, please open an issue at <https://github.com/dandavison/delta/issues>.
For a short help summary, please use delta -h.
and that's the whole page bestie, you made it π this is delta version 0.19.2, dated August 2026 β go forth and diff pretty, no cap π¦πΈ
π¦ where this page comes from
- ubuntu stonking: git-delta 0.19.2+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms