User guide / Themes

Writing a custom theme

Development reference · View source

Declare a theme under themes, then select it with theme:

theme: midnight

themes:
  midnight:
    background: "#10131a"
    foreground: "#d8dee9"
    accent: "#88c0d0"
    syntax:
      comment: "#65737e"
      keyword: "#b48ead"
      string: "#a3be8c"

Every field is optional. An omitted field either takes a fixed default or borrows another role’s colour; the theme colour reference says which.

A theme that sets most roles:

theme: midnight

themes:
  midnight:
    background: "#10131a"
    foreground: "#d8dee9"
    muted: "#65737e"
    whitespace: "#292c33"
    accent: "#88c0d0"
    command: "#8be9fd"
    cursor_normal: "#ff5555"
    cursor_insert: "#ff79c6"
    cursor_replace: "#39ff14"
    cursor_select: "#ffb86c"
    cursor_secondary: "#d8dee9"
    cursor_command: "#bd93f9"
    directory: "#8be9fd"
    destination_file: "#d8dee9"
    destination_explorer: "#8be9fd"
    destination_generated: "#65737e"
    destination_scratch: "#5fd7e7"
    destination_terminal: "#8ddb8c"
    selection: "#2e3440"
    selection_primary: "#694b37"
    fuzzy_match_secondary: "#2e3440"
    fuzzy_match_primary: "#694b37"
    error: "#bf616a"
    warning: "#d08770"
    info: "#a3be8c"
    jump_label_immediate: "#ff5555"
    jump_label_primary: "#5fd7e7"
    jump_label_secondary: "#4ab7c6"
    change_added: "#8ddb8c"
    change_modified: "#d2a8ff"
    change_removed: "#ff7b72"
    diff_added: "#185435"
    diff_removed: "#642830"
    diff_changed: "#51316f"
    syntax:
      comment: "#65737e"
      keyword: "#b48ead"
      markup.heading: "#88c0d0"
      markup.italic: "#b48ead"
      markup.raw: "#a3be8c"
      string: "#a3be8c"

A custom theme is listed, previewed, and sorted into dark or light exactly like a built-in one.