Yazi: A High-Performance Terminal File Manager Built in Rust

7月19日 Published inFile Utilities

Yazi is a high-performance terminal file manager written in Rust. Built on a non-blocking async I/O model, it is designed for speed and efficiency. It offers a highly customizable environment that streamlines file management through a modern, responsive interface.

Key Features

  • Full Asynchronous Support – Every I/O operation is asynchronous. CPU-bound tasks are distributed across multiple threads to maximize hardware resource utilization.
  • Advanced Task Scheduling – Features real-time progress updates, the ability to cancel tasks, and internal priority management for smoother performance.
  • Native Image Protocol Support – Compatible with Überzug++ and Chafa, ensuring image previews work across almost any terminal emulator.
  • Preloading Mechanism – Includes built-in code highlighting and image decoding. A smart preloading system ensures that images and text files are ready to view instantly.
  • Concurrent Plugin System – Highly extensible via Lua. You can customize the UI, add functional logic, or create specialized previewers, preloaders, searchers, and fetchers with minimal code.
  • Data Distribution Service – Utilizes a client-server architecture (without requiring a separate background process) and a Lua-based publish-subscribe model. This enables cross-instance communication and state persistence.
  • Integrated Package Manager – Manage plugins and themes easily with a single command. Supports updating, version pinning, and removal.
  • External Tool Integration – Interfaces seamlessly with standard CLI tools like ripgrep, fd, fzf, and zoxide.
  • Vim-inspired Components – Includes familiar modal inputs, selection menus, confirmation prompts, notifications, and cd path auto-completion.
  • Sophisticated Viewing – Supports multiple tabs, cross-directory selection, and scrollable previews for videos, PDFs, archives, code, and directories.
  • Essential Utilities – Includes batch renaming, archive extraction, visual mode selection, a file picker, Git status integration, and a mount manager.
  • Modern Terminal Standards – Supports themes, mouse interaction, trash bin integration, custom layouts, CSI u, and OSC 52.

Install Yazi

Prerequisites

To function correctly, Yazi requires the file utility (for file type detection).

You can also install the following optional dependencies to enable additional features:

  • nerd-fonts (highly recommended for icons)
  • ffmpeg (for video thumbnails)
  • 7-Zip (for archive extraction and previews)
  • jq (for JSON previews)
  • poppler (for PDF previews)
  • fd (for file searching)
  • rg (for searching file contents)
  • fzf (for fast subtree navigation, requires version ≥0.53.0)
  • zoxide (for history-based directory navigation, requires fzf)
  • resvg (for SVG previews)
  • ImageMagick (for font, HEIC, and JPEG XL previews)
  • xclip / wl-clipboard / xsel (for Linux clipboard support)

If any feature fails to load, ensure these tools are updated to their latest versions.

Installation by Operating System

Follow the instructions below based on your operating system.

Arch Linux

Install the stable version and common dependencies via pacman:

sudo pacman -S yazi ffmpeg 7zip jq poppler fd ripgrep fzf zoxide imagemagick
paru -S resvg

For the latest development version, use the AUR or Arch Linux CN repository:

paru -S yazi-git ffmpeg 7zip jq poppler fd ripgrep fzf zoxide resvg imagemagick

Alternatively, you can install the official nightly binary from the AUR, which is updated every six hours:

paru -S yazi-nightly-bin ffmpeg 7zip jq poppler fd ripgrep fzf zoxide resvg imagemagick

Nix

Yazi is available as a Nix package.

  • NixOS: nix-env -iA nixos.yazi
  • Non-NixOS: nix-env -iA nixpkgs.yazi

Or add it directly to your configuration:

# configuration.nix
environment.systemPackages = with pkgs; [
    yazi
];

Homebrew (macOS / Linux)

First, ensure Homebrew is up to date, then install Yazi and its recommended dependencies:

brew update
brew install yazi ffmpeg sevenzip jq poppler fd ripgrep fzf zoxide resvg imagemagick font-symbols-only-nerd-font

To install the latest development build from the source, use the --HEAD flag:

brew install yazi --HEAD

Windows

Yazi relies on file(1) to detect MIME types. On Windows, the most reliable approach is to install Git for Windows, which includes a bundled file.exe.

  1. Install Git for Windows via the official installer or a package manager.
  2. Add the path to file.exe to your YAZI_FILE_ONE environment variable. The path depends on your installation method:
    • Standard Installer: C:\Program Files\Git\usr\bin\file.exe
    • Scoop: C:\Users\<Username>\scoop\apps\git\current\usr\bin\file.exe
  3. Restart your terminal.

Install via Scoop:

scoop install yazi
# Recommended dependencies:
scoop install ffmpeg 7zip jq poppler fd ripgrep fzf zoxide resvg imagemagick

Install via WinGet:

winget install sxyazi.yazi
# Recommended dependencies:
winget install Gyan.FFmpeg 7zip.7zip jqlang.jq sharkdp.fd BurntSushi.ripgrep.MSVC junegunn.fzf ajeetdsouza.zoxide ImageMagick.ImageMagick

Note: poppler and resvg are not currently available on WinGet. Install them via Scoop or download the binaries manually from their respective project pages.

Other Installation Methods

Yazi is also available via Snapcraft, Flatpak, AOSC OS, and x-cmd. Alternatively, you can download official pre-compiled binaries, install via crates.io, or build directly from the source code.


Yazi Quick Start

Launch and Exit

Once installed, type yazi in your terminal to start the application. Press q to quit, or use F1 (or ~) to access the help menu.

Shell Wrapper

It is highly recommended to use the following shell wrapper (named y). This allows Yazi to change your shell's current working directory to the directory you were browsing when you exited the program.

Configuration for Bash / Zsh:

function y() {
    local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
    yazi "$@" --cwd-file="$tmp"
    IFS= read -r -d '' cwd < "$tmp"
    [ -n "$cwd" ] && [ "$cwd" != "$PWD" ] && builtin cd -- "$cwd"
    rm -f -- "$tmp"
}

Configuration for Fish:

function y
    set tmp (mktemp -t "yazi-cwd.XXXXXX")
    yazi $argv --cwd-file="$tmp"
    if read -z cwd < "$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
        builtin cd -- "$cwd"
    end
    rm -f -- "$tmp"
end

Add the relevant snippet to your shell configuration file (e.g., .bashrc, .zshrc, or config.fish). You can then launch Yazi by typing y.

  • Press q to exit and change the shell directory.
  • Press Q to exit without changing the shell directory.

Main Key Bindings

Navigation

Navigate using the arrow keys or standard Vim keys (h, j, k, l):

Key Alternative Action
k Move cursor up
j Move cursor down
l Enter the highlighted directory
h Move to the parent directory

Additional Navigation:

Key Action
K Scroll up 5 lines in the preview pane
J Scroll down 5 lines in the preview pane
g then g Jump to the top of the list
G Jump to the bottom of the list
z Jump to a directory or file using fzf
Z Jump to a directory using zoxide

Selection

Key Action
Space Toggle selection for the current item
v Enter visual mode (selection)
V Enter visual mode (unselection)
Ctrl + a Select all items
Ctrl + r Invert selection
Esc Clear selection

File Operations

Key Action
o Open selected files
O Open selected files with a specific application (interactive)
Enter Open selected files
Shift + Enter Open selected files interactively (terminal dependent)
Tab Toggle detailed file information
y Copy (yank) selected files
x Cut selected files
p Paste files
P Paste files (overwrite existing)
Y or X Cancel copy/cut operation
d Move selection to trash
D Permanently delete selection
a Create new file (use a trailing / for directories)
r Rename selection
. Toggle hidden files

Path Copying

Key Sequence Action
c then c Copy absolute file path
c then d Copy directory path
c then f Copy filename
c then n Copy filename (excluding extension)

Filter and Find

Key Action
f Filter files in the current view
/ Search for the next file
? Search for the previous file
n Jump to the next match
N Jump to the previous match

Searching

Key Action
s Search filenames using fd
S Search file contents using ripgrep
Ctrl + s Cancel an active search

Sorting

Key Sequence Action
, then m Sort by modification time
, then M Sort by modification time (descending)
, then b Sort by creation time
, then B Sort by creation time (descending)
, then e Sort by extension
, then E Sort by extension (descending)
, then a Sort alphabetically
, then A Sort alphabetically (descending)
, then n Natural sort
, then N Natural sort (descending)
, then s Sort by size
, then S Sort by size (descending)
, then r Randomize order

Tab Management

Key Action
t Open a new tab in the current directory
19 Switch to a specific tab index
[ Switch to the previous tab
] Switch to the next tab
{ Move the current tab to the left
} Move the current tab to the right
Ctrl + c Close the current tab