Modern terminal workflows thrive on visual clarity. When navigating deep directory trees or reviewing complex project structures, default terminal file listings often render files in illegible shades of blue, harsh greens, or generic monochrome text. The standard method for styling terminal file listings involves configuring the LS_COLORS environment variable, a notoriously cryptic string of colon-separated file extensions and ANSI escape codes. vivid is an open-source, themeable LS_COLORS generator written in Rust that simplifies file colour customisation. It provides dozens of expertly crafted colour palettes and automatically generates the precise export strings required by modern shells and tools such as ls, tree, fd, and eza.
Why Use vivid for Terminal File Highlighting?
Configuring terminal highlighting manually requires calculating 8-bit or 24-bit ANSI colour sequences for dozens of individual extensions, MIME categories, socket types, symlinks, and directory permissions. Vivid completely abstracts this complexity:
- Curated Colour Palettes: Ships with out-of-the-box support for popular developer themes, including Catppuccin, Dracula, Gruvbox, Nord, Solarized, OneDark, and TokyoNight.
- Truecolor (24-bit) and 8-bit Support: Generates crisp 24-bit truecolor definitions for modern terminal emulators (such as Alacritty, Kitty, WezTerm, and Ghostty) alongside fallback 8-bit ANSI profiles for legacy consoles.
- Extensive Filetype Database: Categorises archives, media files, temporary files, configuration formats, cryptographic certificates, build artefacts, and programming source files with distinct hues.
- Broad Tool Compatibility: In addition to standard GNU
ls, the generatedLS_COLORSvariable is natively respected by modern CLI alternatives such asfd,eza, and shell completion menus in Zsh and Fish.
How to Install vivid in Linux
Vivid is packaged across most major Linux distributions and can also be installed via Cargo or pre-compiled release binaries.
Method 1: Install via Native Package Managers
On Debian, Ubuntu, and derivatives (Ubuntu 24.04 LTS and newer), install Vivid directly through APT:
sudo apt update && sudo apt install vivid
On Arch Linux and Manjaro, Vivid is available in the official extra repository:
sudo pacman -S vivid
On Fedora and Red Hat Enterprise Linux:
sudo dnf install vivid
On openSUSE Tumbleweed or Leap:
sudo zypper install vivid
Method 2: Install via Cargo (Rust Toolchain)
If your distribution repositories provide an older build, install the latest upstream release using Cargo:
cargo install vivid
How to Preview and Select Themes in vivid
Vivid includes a built-in preview and listing mechanism so you can inspect available colour schemes directly inside your active terminal window.
- List all available built-in themes by executing:
You will see popular themes such asvivid themescatppuccin-mocha,dracula,gruvbox-dark,nord,snazzy, andtokyonight-night. - Preview how a specific theme renders different file categories by generating an output sample:
Vivid will print a formatted table displaying directories, symlinks, executable binaries, images, videos, audio tracks, compressed archives, and source code files styled according to the selected palette.vivid preview dracula - Compare light and dark variants to match your terminal emulator’s background:
vivid preview solarized-dark vivid preview solarized-light
How to Configure Your Shell to Apply vivid LS_COLORS Automatically
To ensure your terminal file listings remain styled across all future terminal sessions, export the generated LS_COLORS variable within your shell’s configuration file.
For Bash Users (~/.bashrc)
Open your Bash configuration file in your preferred text editor:
nano ~/.bashrc
Append the following line at the end of the file, replacing catppuccin-mocha with your preferred theme:
# Apply vivid theme to LS_COLORS
export LS_COLORS="$(vivid generate catppuccin-mocha)"
Save the file (Ctrl + O, then Enter) and exit (Ctrl + X). Reload the configuration into your active shell:
source ~/.bashrc
For Zsh Users (~/.zshrc)
Open your Zsh configuration:
nano ~/.zshrc
Add the export line along with completion styling:
# Apply vivid theme to LS_COLORS and completion lists
export LS_COLORS="$(vivid generate dracula)"
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
Save and reload your Zsh environment:
source ~/.zshrc
For Fish Users (~/.config/fish/config.fish)
For Fish shell users, define the environment variable inside config.fish:
set -gx LS_COLORS (vivid generate nord)
Optimising Performance for Fast Shell Startup
Running vivid generate <theme> synchronously each time a new terminal tab opens introduces a tiny sub-millisecond execution overhead. If you prioritise instantaneous sub-shell launches, pre-generate your colour string into a static cache file:
- Generate and save the static colour definition file:
vivid generate catppuccin-mocha > ~/.config/ls_colors_theme - Update your
~/.bashrcor~/.zshrcto read the cached file instead of spawning a new process:export LS_COLORS="$(cat ~/.config/ls_colors_theme)"
Whenever you choose to switch colour palettes in the future, simply re-run the vivid generate command redirected to that cache path.