terminal

Slatewave for bat

A Slatewave theme for bat — the cat clone with syntax highlighting.

Latest release
0.0.1 · last month
Last commit
3 weeks ago
// bat --theme=Slatewave server.go
package main

import (
    "log"
    "net/http"
)

const port = ":8080"

type Server struct {
    Name   string
    Routes map[string]http.HandlerFunc
}

func (s *Server) Hello(w http.ResponseWriter, r *http.Request) {
    // greet the caller in the slatewave palette
    w.Header().Set("Content-Type", "text/plain")
    w.Write([]byte("slate below, teal above"))
}

func main() {
    s := &Server{Name: "slatewave", Routes: nil}
    http.HandleFunc("/", s.Hello)
    log.Fatal(http.ListenAndServe(port, nil))
}

About this theme

A .tmTheme syntax theme for bat, mirroring the Slatewave Sublime Text scope mapping so files printed in your terminal highlight the same way they do in your editor — and the same theme cascades to any tool that delegates highlighting to bat (delta, fzf preview, ripgrep-all).

Slatewave for bat is a Sublime Text–compatible .tmTheme file — the format bat consumes via syntect. Scope mapping is identical to the Sublime Text port, so a Go, TypeScript, or Markdown file that highlights a certain way in your editor highlights the same way when piped through bat in the terminal.

Once registered with bat cache --build, the theme cascades to every tool that delegates highlighting to bat: git-delta for pretty diffs, fzf --preview for file previews, and ripgrep-all when piped through a pager. Set it once, get it everywhere.

Requires a true-color terminal — at 256 colors the slate ramp collapses and the accent hues drift. Pair with any of the Slatewave terminal ports (Alacritty, Ghostty, iTerm2, WezTerm, Windows Terminal) for the matched chrome.

Verify

After install, Slatewave should appear in bat’s theme list and render via the --theme flag:

bat --list-themes | grep Slatewave
bat --theme=Slatewave --color=always /path/to/some.go | head -40

Pair with delta

git-delta reads bat’s theme cache. Once Slatewave is registered there, point delta at it from your ~/.gitconfig:

[delta]
    syntax-theme = Slatewave

Install

Don't have the CLI yet? Install the Slatewave CLI →

  • Slatewave CLI

    Install with the Slatewave family CLI — one command, every theme.

    slatewave install bat
  • curl

    Drop the .tmTheme into bat's themes directory. Requires bat ≥ 0.18.

    mkdir -p "$(bat --config-dir)/themes" && curl -fsSL https://raw.githubusercontent.com/kevinlangleyjr/bat-slatewave/main/Slatewave.tmTheme -o "$(bat --config-dir)/themes/Slatewave.tmTheme"
  • Clone

    Clone into bat's themes directory — bat scans subdirectories recursively for .tmTheme files.

    mkdir -p "$(bat --config-dir)/themes" && git clone https://github.com/kevinlangleyjr/bat-slatewave.git "$(bat --config-dir)/themes/bat-slatewave"
  • Rebuild bat's theme cache

    bat caches compiled themes on disk — rebuild after adding one or it won't show up in --list-themes.

    bat cache --build
  • Activate

    Tell bat to use Slatewave by default. Pick the path that fits — config file is persistent, env var is session-scoped.

    1. Config file (persistent) — `echo '--theme="Slatewave"' > "$(bat --config-file)"`
    2. zsh / bash env var — `export BAT_THEME=Slatewave`
    3. fish env var — `set -gx BAT_THEME Slatewave`