Yazi uses a flexible opener system to determine which external programs should open different file types. This page explains how to configure file openers.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sxyazi/yazi/llms.txt
Use this file to discover all available pages before exploring further.
Configuration Location
File opener configuration is part ofyazi.toml:
- Unix-like systems:
~/.config/yazi/yazi.toml - Windows:
%AppData%\yazi\config\yazi.toml
How Openers Work
Yazi’s opener system has two parts:- [opener] - Define external programs and how to launch them
- [open] - Define rules that match files to openers
Defining Openers
Openers are defined in the[opener] section:
Opener Fields
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
Description shown in the opener picker
Platform filter. Only use this opener on matching platforms:
unix- All Unix-like systemslinux- Linux onlymacos- macOS onlywindows- Windows onlyandroid- Android (Termux) only
Block the terminal until the command finishes when
trueDetach 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
URL pattern to match. Supports wildcards:
*/- Directories*.txt- Files ending with .txt*- All files (fallback)
MIME type pattern to match. Supports wildcards:
text/*- All text filesimage/*- All images{audio,video}/*- Audio or videoapplication/json- Specific type
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: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”:- Verify the program is installed
- Check that the program is in your PATH
- 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, addorphan = true: