Skip to main content
Yazi uses a flexible opener system to determine which external programs should open different file types. This page explains how to configure file openers.

Configuration Location

File opener configuration is part of yazi.toml:
  • Unix-like systems: ~/.config/yazi/yazi.toml
  • Windows: %AppData%\yazi\config\yazi.toml

How Openers Work

Yazi’s opener system has two parts:
  1. [opener] - Define external programs and how to launch them
  2. [open] - Define rules that match files to openers

Defining Openers

Openers are defined in the [opener] section:

Opener Fields

string
required
Command to execute. Use placeholders:
  • %s - Single selected file
  • %s1 - First selected file (useful on Windows)
  • %S - All selected files (space-separated)
  • %d - Directory of selected file
  • %d1 - Directory of first selected file
  • ${EDITOR} - Environment variable
string
required
Description shown in the opener picker
string
Platform filter. Only use this opener on matching platforms:
  • unix - All Unix-like systems
  • linux - Linux only
  • macos - macOS only
  • windows - Windows only
  • android - Android (Termux) only
boolean
default:"false"
Block the terminal until the command finishes when true
boolean
default:"false"
Detach the process from the terminal when true. Useful for GUI applications.

Example Openers

File Opening Rules

Rules are defined in the [open] section and match files to openers:

Rule Fields

string
URL pattern to match. Supports wildcards:
  • */ - Directories
  • *.txt - Files ending with .txt
  • * - All files (fallback)
string
MIME type pattern to match. Supports wildcards:
  • text/* - All text files
  • image/* - All images
  • {audio,video}/* - Audio or video
  • application/json - Specific type
string | array
Opener(s) to use:
  • Single string: "edit"
  • Array: ["edit", "open", "reveal"] - Shows picker with options
Rules are evaluated in order. The first matching rule is used.

Example Rules

Complete Example

Platform-Specific Configuration

You can define different openers for different platforms:

Advanced Usage

Multiple Files

Open multiple selected files:

Environment Variables

Use environment variables for flexibility:

Custom Scripts

Launch custom scripts:

Conditional Opening

Use MIME types to open files conditionally:

Interactive Opener Selection

When multiple openers are specified in a rule, Yazi shows a picker:
Press O (uppercase) or use open --interactive to force the picker even with a single opener.

Troubleshooting

Command Not Found

If an opener fails with “command not found”:
  1. Verify the program is installed
  2. Check that the program is in your PATH
  3. Use absolute paths if needed: /usr/bin/mpv %s

Windows Path Issues

On Windows, use %s1 instead of %s for compatibility:

GUI Apps Don’t Detach

If GUI applications block the terminal, add orphan = true:

See Also