Skip to main content

theme.toml

tip

If you're looking for ready-made themes and don't want to create one yourself, check out the yazi-rs/flavors repository.

Types

Color

A color. It can be in Hex format with RGB values, such as "#484D66". Or can be one of the following 17 values:

  • "reset"
  • "black"
  • "white"
  • "red"
  • "lightred"
  • "green"
  • "lightgreen"
  • "yellow"
  • "lightyellow"
  • "blue"
  • "lightblue"
  • "magenta"
  • "lightmagenta"
  • "cyan"
  • "lightcyan"
  • "gray"
  • "darkgray"

Style

Appears in a format similar to { fg = "#e4e4e4", bg = "black", ... }, and supports the following properties:

  • fg (Color): Foreground color
  • bg (Color): Background color
  • bold (Boolean): Bold
  • dim (Boolean): Dim (not supported by all terminals)
  • italic (Boolean): Italic
  • underline (Boolean): Underline
  • blink (Boolean): Blink
  • blink_rapid (Boolean): Rapid blink
  • reversed (Boolean): Reversed foreground and background colors
  • hidden (Boolean): Hidden
  • crossed (Boolean): Crossed out

[flavor]

See flavor documentation for more details.

dark

Flavor name used in dark mode, e.g. "dracula".

Typestring

light

Flavor name used in light mode, e.g. "gruvbox".

Typestring

[mgr]

cwd

CWD text style.

TypeStyle

hovered

Hovered file style.

TypeStyle

preview_hovered

Hovered file style, in the preview pane.

TypeStyle

find_keyword

Style of the highlighted portion in the filename.

TypeStyle

find_position

Style of current file location in all found files to the right of the filename.

TypeStyle

marker_copied

Copied file marker style.

TypeStyle

marker_cut

Cut file marker style.

TypeStyle

marker_marked

Marker style of pre-selected file in visual mode.

TypeStyle

marker_selected

Selected file marker style.

TypeStyle

count_copied

Style of copied file number.

TypeStyle

count_cut

Style of cut file number.

TypeStyle

count_selected

Style of selected file number.

TypeStyle

border_symbol

Border symbol, e.g. "│".

Typestring

border_style

Border style.

TypeStyle

syntect_theme

Code preview highlighting themes, which are paths to .tmTheme files. You can find them on GitHub using "tmTheme" as a keyword

For example, "~/Downloads/Dracula.tmTheme", not available after using a flavor, as flavors always use their own tmTheme files tmtheme.xml.

Typestring

[tabs]

Explanation of active and inactive

active

Active tab style.

TypeStyle

inactive

Inactive tab style.

TypeStyle

sep_inner

Inner separator symbol, e.g. { open = "[", close = "]" }.

Type{ open: string, close: string }

sep_outer

Outer separator symbol, e.g. { open = "", close = "" }.

Type{ open: string, close: string }

[mode]

normal_main

Normal mode main style.

TypeStyle

normal_alt

Normal mode alternative style.

TypeStyle

select_main

Select mode main style.

TypeStyle

select_alt

Select mode alternative style.

TypeStyle

unset_main

Unset mode main style.

TypeStyle

unset_alt

Unset mode alternative style.

TypeStyle

[status]

Explanation of sep_left and sep_right

overall

Overall status bar style.

TypeStyle

sep_left

Left separator symbol, e.g. { open = "", close = "]" }.

Type{ open: string, close: string }

sep_right

Right separator symbol, e.g. { open = "[", close = "" }.

Type{ open: string, close: string }

perm_type

Style of the file type symbol, such as d for directory, - for file, l for symlink, etc.

TypeStyle

perm_read

Style of the read permission symbol (r).

TypeStyle

perm_write

Style of the write permission symbol (w).

TypeStyle

perm_exec

Style of the execute permission symbol (x).

TypeStyle

perm_sep

Style of the permission separator symbol (-).

TypeStyle

progress_label

Progress label style.

TypeStyle

progress_normal

Style of the progress bar when it is not in an error state.

TypeStyle

progress_error

Style of the progress bar when an error occurs.

TypeStyle

[which]

cols

Number of columns.

Type1 | 2 | 3

mask

Mask style.

TypeStyle

cand

Candidate key style.

TypeStyle

rest

Rest key style.

TypeStyle

desc

Description style.

TypeStyle

separator

Separator symbol, e.g. " -> ".

Typestring

separator_style

Separator style.

TypeStyle

[confirm]

border

Border style.

TypeStyle

title

Title style.

TypeStyle

content

Content style.

TypeStyle

list

List style, which is the style of the list of items below the content.

TypeStyle

btn_yes

The style of the yes button.

TypeStyle

btn_no

The style of the no button.

TypeStyle

btn_labels

Labels for the yes and no buttons.

The first string is the label for the yes button and the second is the label for the no button.

Type[string, string]

[spot]

Explanation of tbl_col and tbl_cell

border

Border style.

TypeStyle

title

Title style.

TypeStyle

tbl_col

The style of the selected column in the table.

TypeStyle

tbl_cell

The style of the selected cell in the table.

TypeStyle

[notify]

title_info

Style of the info title.

TypeStyle

title_warn

Style of the warning title.

TypeStyle

title_error

Style of the error title.

TypeStyle

[pick]

border

Border style.

TypeStyle

active

Selected item style.

TypeStyle

inactive

Unselected item style.

TypeStyle

[input]

border

Border style.

TypeStyle

title

Title style.

TypeStyle

value

Value style.

TypeStyle

selected

Selected value style.

TypeStyle

[cmp]

border

Border style.

TypeStyle

active

Selected item style.

TypeStyle

inactive

Unselected item style.

TypeStyle

icon_file

File icon.

Typestring

icon_folder

Folder icon.

Typestring

icon_command

Command icon.

Typestring

[tasks]

border

Border style.

TypeStyle

title

Title style.

TypeStyle

hovered

Hovered item style.

TypeStyle

[help]

on

Key column style.

TypeStyle

run

Command column style.

TypeStyle

desc

Description column style.

TypeStyle

hovered

Hovered item style.

TypeStyle

footer

Footer style.

TypeStyle

icon_info

Info icon.

Typestring

icon_warn

Warning icon.

Typestring

icon_error

Error icon.

Typestring

[filetype]

Set file list item display styles for specific file types, supporting matching by name and mime-type:

[filetype]
rules = [
# Images
{ mime = "image/*", fg = "yellow" },

# Videos
{ mime = "video/*", fg = "magenta" },
{ mime = "audio/*", fg = "magenta" },

# Empty files
{ mime = "inode/empty", fg = "cyan" },

# Orphan symbolic links
{ name = "*", is = "orphan", fg = "red" },

# ...

# Fallback
# { name = "*", fg = "white" },
{ name = "*/", fg = "blue" }
]

Each rule supports complete Style properties. There are two special rule:

  • name = "*" matches all files.
  • name = "*/" matches all directories.

You can restrict the specific type of files through is, noting that it must be used with either name or mime. It accepts the following values:

  • block: Block device
  • char: Char device
  • exec: Executable
  • fifo: FIFO
  • link: Symbolic link
  • orphan: Orphan symbolic link
  • sock: Socket
  • sticky: File with sticky bit set

[icon]

Yazi has builtin support for nvim-web-devicons, a rich set of icons ready to use. If you want to add your own rules to this set, you can use prepend_* and append_* to prepend or append rules to the default ones (see Configuration Mixing for details):

[icon]
prepend_dirs = [
{ name = "desktop", text = "", fg = "#563d7c" },
# ...
]
append_exts = [
{ name = "mp3", text = "", fg = "#00afff" },
# ...
]
# ...

If you want to completely override the default rules, you can do so with:

[icon]
dirs = [
{ name = "desktop", text = "", fg = "#563d7c" },
# ...
]
exts = [
{ name = "mp3", text = "", fg = "#00afff" },
# ...
]
# ...

Each icon rule contains the following properties:

  • name (globs, dirs, files, exts), or if (conds): the rule itself, which is a string
  • text: icon text, which is a string
  • fg: icon color, which is a Color

Icons are matched according to the following priority:

  1. globs: glob expressions, e.g., { name = "**/Downloads/*.zip", ... }
  2. dirs: directory names, e.g., { name = "Desktop", ... }
  3. files: file names, e.g., { name = ".bashrc", ... }
  4. exts: extensions, e.g., { name = "mp3", ... }
  5. conds: conditions, e.g., { if = "!dir", ... }

dirs, files, and exts are compiled into a HashMap at startup, offering O(1) time complexity for very fast lookups, which should meet most needs.

For more complex and precise rules, such as matching a specific file in a specific directory, use globs - these are always executed first to check if any rules in the glob set are met. However, they are much slower than dirs, files, and exts, so it's not recommended to use them excessively.

If none of the above rules match, it will fall back to conds to check if any specific conditions are met. conds are mostly used for rules related to file metadata, which includes the following conditional factors:

  • dir: The file is a directory
  • hidden: The file is hidden
  • link: The file is a symbolic link
  • orphan: The file is an orphan (broken symbolic link)
  • dummy: The file is dummy (failed to load complete metadata, possibly the filesystem doesn't support it, such as FUSE)
  • block: The file is a block device
  • char: The file is a char device
  • fifo: The file is a FIFO
  • sock: The file is a socket
  • exec: The file is executable
  • sticky: The file has the sticky bit set

These conditions support basic | (or), & (and), ! (not), and () for priority, so you can combine them as needed, for example:

[icon]
prepend_conds = [
{ if = "hidden & dir", text = "👻" }, # Hidden directories
{ if = "dir", text = "📁" }, # Directories
{ if = "!(dir | link)", text = "📄" }, # Normal files (not directories or symlinks)
]