Skip to content

Bat theme support

Víctor González Prieto edited this page Feb 17, 2025 · 8 revisions

Choosing a theme

cmd-help.sublime-syntax works nicely with 2/3rds of the themes bundled with bat.

But it's still worth checking that your default bat theme is included in the list of supported themes below.

If it's unsupported and you want to use a different theme for bathelp, then add --theme='<THEME_NAME>' to your bathelp options..

Some themes also highlight with italic styles. If they do (see below) and you want to enable it, you should add --italic-text=always.

Here's an example with both options:

alias bathelp="bat --plain --language=help --theme='Sublime Snazzy' --italic-text=always"

What do we mean by support?

We consider a bat theme to be supported if the colors it uses for each cmd-help scope (token type) are different.

For instance: If both --options and <arguments> are highlighted in green, then support for that theme is suboptimal.

If a theme doesn't highlight a scope (i.e.: it's the same color as plain text), then it's also badly supported.

Some scopes are less relevant than others, and lacking support for them is not so important. For instance, it's not a big deal if path/names are highlighted with the same color as arguments, or not highlighted at all.

List of themes by support level

  • Optimal support

    • Monokai Extended (default)
    • Monokai Extended Light (default light)
    • 1337
    • Coldark-Cold
    • Coldark-Dark
    • Dracula
    • Monokai Extended Origin
    • OneHalfDark
    • OneHalfLight
    • Solarized (dark)
    • Solarized (light)
    • Sublime Snazzy
    • TwoDark
    • Visual Studio Dark+
    • ansi
  • Partial support

    • GitHub: subcommands = pathnames (very minor issue)
    • Monokai Extended Bright: headings = pathnames (minor issue)
    • base16 on a dark terminal theme: pathnames not colorized (minor issue)
    • zenburn: headings = subcommands = pathnames (regular issues)
  • Unsupported

    • DarkNeon: options not colorized
    • Nord: headings = options, subcommands & pathnames not colorized
    • base16 on a light terminal theme: normal text barely visible
    • base16-256 on a dark terminal theme: subcommands colorized in black (poor contrast with background color)
    • base16-256 on a light terminal theme: normal text colorized in grey (barely visible, poor contrast)
    • gruvbox-dark: headings = options, pathnames not colorized
    • gruvbox-light: headings = options, pathnames not colorized

Other theme features

Note that ansi, base16 and base16-256 are 8-bit themes. As explained in the bat Readme, they adapt to the colors defined by your terminal program.

The themes that use italics for the cmd-help scopes are:

  • 1337
  • Dracula
  • Monokai Extended Bright
  • Monokai Extended
  • Monokai Extended Light
  • Monokai Extended Origin
  • Sublime Snazzy

Theme support demos

You can find screenshots for each working theme in the demo branch.

Or better yet, look up the screenshots in this PR, which is more recent.

Creating a custom theme

You can also create a custom theme that targets the cmd-help scopes. You have to add it to bat as a custom theme and then configure it like any other theme.

Themes must be tmTheme format files. For instance, this custom theme targets cmd-help (among a few other syntaxes).