Skip to main content

Yazi: A Terminal File Manager Written in Rust

·403 words·2 mins
[Your Name]
Author
[Your Name]
Capturing light with Sony A7R2, building workflows with NixOS & Emacs, exploring LLMs and Agents.
Table of Contents
NixOS Toolchain - This article is part of a series.
Part 2: This Article

The spiritual successor to Ranger, rewritten in Rust—ten times faster.

Yazi is a Rust-based terminal file manager aiming to be “Finder in the terminal.” It supports async I/O, parallel preview, and a built-in plugin system, delivering a very modern experience.

Installation
#

In NixOS home.nix or configuration.nix:

home.packages = with pkgs; [
  yazi
];

Or install via cargo:

cargo install --locked yazi-fm yazi-cli

Basic Operations
#

Launch: yazi

KeyAction
j/k or ↓/↑Move up/down
h/l or ←/→Enter/exit directory
EnterOpen file
SpaceSelect/deselect
yCopy
dCut
pPaste
DDelete (to trash)
/Search
zJump (zoxide integration)
~Go to home directory

Killer Features
#

1. Real-time Preview
#

Preview content without opening files:

  • Images: Display directly in terminal (requires sixel/kitty/iTerm2 support)
  • PDF: First page thumbnail
  • Video: First frame screenshot
  • Code: Syntax highlighting

Works best with Kitty terminal on NixOS.

2. Async Operations
#

Copying a 10GB folder won’t block the UI. You can continue browsing while the operation runs in the background.

3. Zoxide Integration
#

If you use zoxide (the z command), Yazi has built-in support:

Press z → type "doc" → Enter
Jumps directly to ~/Documents

4. Shell Integration
#

Add to .bashrc / .zshrc / config.fish:

# Auto-cd to current directory on quit
function yy() {
  local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
  yazi "$@" --cwd-file="$tmp"
  if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
    cd -- "$cwd"
  fi
  rm -f -- "$tmp"
}

Usage: yy to launch Yazi, press q to quit, and your shell automatically cds to the last visited directory.

Configuration
#

Yazi config lives in ~/.config/yazi/:

~/.config/yazi/
├── yazi.toml        # Main config
├── keymap.toml      # Key bindings
├── theme.toml       # Theme
└── plugins/         # Plugins

My keymap.toml snippet
#

[[manager.prepend_keymap]]
on = [ "g", "d" ]
run = 'cd ~/Documents'
desc = "Go to Documents"

[[manager.prepend_keymap]]
on = [ "g", "D" ]
run = 'cd ~/Downloads'
desc = "Go to Downloads"

[[manager.prepend_keymap]]
on = [ "g", "c" ]
run = 'cd ~/.config'
desc = "Go to Config"

Ranger vs Yazi
#

FeatureRangerYazi
LanguagePythonRust
StartupSlow (~1s)Instant (<50ms)
Async I/ONoNative
Image PreviewExtra config neededWorks out of the box
Plugin EcosystemRichGrowing
MemoryHigherVery low

If you’re still using Ranger, I highly recommend trying Yazi. Same muscle memory, but several levels better.


Next up: Fish Shell Configuration Guide

NixOS Toolchain - This article is part of a series.
Part 2: This Article