# Yazi FM Expert Cheatsheet

Yazi starts with `yazi`; the official quick start recommends `q` to quit and `F1` or `~` for the built-in help menu ([Yazi Quick Start](https://yazi-rs.github.io/docs/quick-start/)). For day-to-day terminal integration, use the `y` shell wrapper so exiting with `q` can change the parent shell’s current directory; use `Q` when you want to quit without changing the parent shell directory ([Yazi Quick Start](https://yazi-rs.github.io/docs/quick-start/)).

## Install and prerequisites

Yazi requires `file` for file type detection, and the optional feature stack includes Nerd Fonts, `ffmpeg`, 7-Zip, `jq`, `poppler`, `fd`, `ripgrep`, `fzf`, `zoxide`, `resvg`, ImageMagick, and Linux clipboard tools such as `xclip`, `wl-clipboard`, or `xsel` ([Yazi Installation](https://yazi-rs.github.io/docs/installation/)). On Windows, the official docs recommend using Git for Windows’ `file.exe` and wiring it through `YAZI_FILE_ONE`, because other package sources can mishandle Unicode filenames and required parameters ([Yazi Installation](https://yazi-rs.github.io/docs/installation/)).

Common install commands:

```bash
# Arch
sudo pacman -S yazi ffmpeg 7zip jq poppler fd ripgrep fzf zoxide resvg imagemagick

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

# Scoop
scoop install yazi ffmpeg 7zip jq poppler fd ripgrep fzf zoxide resvg imagemagick

# WinGet
winget install sxyazi.yazi
```

## Core navigation

| Key | Action |
|---|---|
| `h` / `←` | Leave to parent directory |
| `j` / `↓` | Move cursor down |
| `k` / `↑` | Move cursor up |
| `l` / `→` | Enter hovered directory |
| `K` / `J` | Seek preview up / down |
| `g g` | Move cursor to top |
| `G` | Move cursor to bottom |
| `z` | Change directory or reveal file via `fzf` |
| `Z` | Change directory via `zoxide` |
| `g Space` | Change directory or reveal file via interactive prompt |

The navigation bindings above are listed in the official Yazi quick start, and `z` / `Z` depend on optional tools such as `fzf` and `zoxide` being installed ([Yazi Quick Start](https://yazi-rs.github.io/docs/quick-start/), [Yazi Installation](https://yazi-rs.github.io/docs/installation/)).

## Selection and file operations

| Key | Action |
|---|---|
| `Space` | Toggle selection of hovered item |
| `v` | Enter visual selection mode |
| `V` | Enter visual unset mode |
| `Ctrl-a` | Select all files |
| `Ctrl-r` | Invert selection |
| `Esc` | Cancel selection or active mode |
| `o` / `Enter` | Open selected files |
| `O` / `Shift-Enter` | Open selected files interactively |
| `Tab` | Show file information |
| `y` | Yank selected files for copy |
| `x` | Yank selected files for cut |
| `p` | Paste yanked files |
| `P` | Paste and overwrite |
| `Y` / `X` | Cancel yank status |
| `d` | Trash selected files |
| `D` | Delete permanently |
| `a` | Create file or directory |
| `r` | Rename selected file or bulk rename selected files |
| `.` | Toggle hidden files |

Yazi’s keymap action reference defines `escape` as a context-aware cancellation action, `remove --permanently` as permanent deletion, and `rename` as single rename or bulk rename through `$EDITOR` when multiple files are selected ([Yazi keymap.toml](https://yazi-rs.github.io/docs/configuration/keymap/)).

## Copy paths and shell integration

| Key | Action |
|---|---|
| `c c` | Copy file path |
| `c d` | Copy directory path |
| `c f` | Copy filename |
| `c n` | Copy filename without extension |
| `;` | Run shell command |
| `:` | Run blocking shell command |
| `-` | Symlink yanked files using absolute paths |
| `_` | Symlink yanked files using relative paths |
| `Ctrl--` | Hardlink yanked files |

The `shell` action supports command templates, blocking execution with `--block`, orphaning with `--orphan`, interactive prompts with `--interactive`, and placeholders such as `%h`, `%s`, `%d`, `%H`, `%S`, and `%D` for hovered or selected paths and URLs ([Yazi keymap.toml](https://yazi-rs.github.io/docs/configuration/keymap/)).

## Search, find, filter, and sort

| Key | Action |
|---|---|
| `f` | Filter current file list |
| `/` | Find next file |
| `?` | Find previous file |
| `n` | Go to next found match |
| `N` | Go to previous found match |
| `s` | Search filenames with `fd` |
| `S` | Search file contents with `ripgrep` |
| `Ctrl-s` | Cancel ongoing search |
| `, m` / `, M` | Sort by modified time / reverse |
| `, b` / `, B` | Sort by birth time / reverse |
| `, e` / `, E` | Sort by extension / reverse |
| `, a` / `, A` | Sort alphabetically / reverse |
| `, n` / `, N` | Sort naturally / reverse |
| `, s` / `, S` | Sort by size / reverse |
| `, r` | Sort randomly |

Yazi distinguishes alphabetical sorting, where `10.md` sorts before `2.md`, from natural sorting, where `2.md` sorts before `10.md` ([Yazi keymap.toml](https://yazi-rs.github.io/docs/configuration/keymap/)). Filename search uses `fd`, content search uses `ripgrep`, and both are optional dependencies in the installation guide ([Yazi Quick Start](https://yazi-rs.github.io/docs/quick-start/), [Yazi Installation](https://yazi-rs.github.io/docs/installation/)).

## Tabs

| Key | Action |
|---|---|
| `t` | Create new tab at current directory |
| `1`..`9` | Switch to tab N |
| `[` / `]` | Switch to previous / next tab |
| `{` / `}` | Swap current tab with previous / next tab |
| `Ctrl-c` | Close current tab |

The keymap reference defines tab primitives as `tab_create`, `tab_switch`, `tab_swap`, and `tab_close`; `close` exits Yazi if the current tab is the last tab ([Yazi keymap.toml](https://yazi-rs.github.io/docs/configuration/keymap/)).

## Configuration model

Yazi uses `yazi.toml` for general configuration, `keymap.toml` for keybindings, and `theme.toml` for colors; the files live under `~/.config/yazi/` on Unix-like systems and `%AppData%\yazi\config\` on Windows ([Yazi Configuration](https://yazi-rs.github.io/docs/configuration/overview/)). To override only selected defaults, put just the changed section in your config file instead of copying the full preset file ([Yazi Configuration](https://yazi-rs.github.io/docs/configuration/overview/)).

```toml
# ~/.config/yazi/yazi.toml
[mgr]
show_hidden = true
```

For keybindings, `prepend_keymap` inserts bindings before defaults, `append_keymap` inserts after defaults, and `keymap` replaces defaults entirely ([Yazi keymap.toml](https://yazi-rs.github.io/docs/configuration/keymap/)). Since Yazi uses the first matching keybinding, `prepend_keymap` has higher priority than default bindings while `append_keymap` has lower priority ([Yazi keymap.toml](https://yazi-rs.github.io/docs/configuration/keymap/)).

```toml
# ~/.config/yazi/keymap.toml
[[mgr.prepend_keymap]]
on = [ "g", "d" ]
run = "cd ~/Downloads"
desc = "Cd to ~/Downloads"

[[mgr.prepend_keymap]]
on = [ "g", "p" ]
run = "cd ~/Pictures"
desc = "Cd to ~/Pictures"
```

## Key notation

Keybinding rules use `on` for the trigger, `run` for the action, and `desc` for help text; keys can be plain characters, named keys such as `<Enter>`, or modified keys such as `<C-a>`, `<S-...>`, `<A-...>`, and `<D-...>` ([Yazi keymap.toml](https://yazi-rs.github.io/docs/configuration/keymap/)). The official docs note that Command/Super bindings depend on terminal support and CSI u, macOS Option-to-Alt mappings require terminal support, and legacy terminal protocols can collapse keys like `<Tab>` and `<C-i>` unless CSI u is enabled ([Yazi keymap.toml](https://yazi-rs.github.io/docs/configuration/keymap/)).

## Expert snippets

### Open a blocking shell in the current directory

```toml
[[mgr.prepend_keymap]]
on = "!"
for = "unix"
run = 'shell "$SHELL" --block'
desc = "Open $SHELL here"

[[mgr.prepend_keymap]]
on = "!"
for = "windows"
run = 'shell "powershell.exe" --block'
desc = "Open PowerShell here"
```

The `--block` option hides Yazi into a secondary screen and runs the program on the main screen until it exits, which is useful for interactive shell sessions ([Yazi keymap.toml](https://yazi-rs.github.io/docs/configuration/keymap/), [Yazi Tips](https://yazi-rs.github.io/docs/tips/)).

### Make Esc close inputs immediately

```toml
[[input.prepend_keymap]]
on = "<Esc>"
run = "close"
desc = "Cancel input"
```

The official tips page suggests remapping input-layer `<Esc>` from `escape` to `close` if you want input boxes to behave like ordinary cancelable input fields instead of entering Vi-style normal mode first ([Yazi Tips](https://yazi-rs.github.io/docs/tips/)).

### Jump to the current Git repository root

```toml
[[mgr.prepend_keymap]]
on = [ "g", "r" ]
run = 'shell -- ya emit cd "$(git rev-parse --show-toplevel)"'
desc = "Cd to Git root"
```

This pattern uses the `ya emit` interface to send a `cd` command back to Yazi from a shell command ([Yazi Tips](https://yazi-rs.github.io/docs/tips/), [Yazi CLI](https://yazi-rs.github.io/docs/cli/)).

### Disable a preset keybinding

```toml
[[mgr.prepend_keymap]]
on = [ "g", "c" ]
run = "noop"
```

Yazi provides a virtual `noop` action specifically for disabling preset keybindings without rewriting the entire keymap ([Yazi keymap.toml](https://yazi-rs.github.io/docs/configuration/keymap/)).

## Plugin and flavor management

Yazi ships with the companion `ya` CLI, and the docs say the `ya` and `yazi` versions should match exactly ([Yazi CLI](https://yazi-rs.github.io/docs/cli/)). Use `ya pkg add owner/my-plugin`, `ya pkg add yazi-rs/plugins:git`, `ya pkg list`, `ya pkg install`, `ya pkg upgrade`, and `ya pkg delete` to manage plugins and flavors through `package.toml` locks ([Yazi CLI](https://yazi-rs.github.io/docs/cli/)).

```bash
ya pkg add yazi-rs/plugins:git
ya pkg list
ya pkg upgrade
ya pkg delete yazi-rs/plugins:git
```

## Performance notes

For network files, the official tips recommend disabling previewers and preloaders because previewing remote content downloads it locally; for low-spec devices, reducing concurrency can help; and if image previews are unnecessary, disabling image previewing/preloading reduces I/O and decode work ([Yazi Tips](https://yazi-rs.github.io/docs/tips/)). If image preview latency is high on fast terminals, the tips page suggests lowering `image_delay` or setting it to `0` ([Yazi Tips](https://yazi-rs.github.io/docs/tips/)).

## Official source links

- [Yazi Quick Start](https://yazi-rs.github.io/docs/quick-start/)
- [Yazi keymap.toml](https://yazi-rs.github.io/docs/configuration/keymap/)
- [Yazi Configuration](https://yazi-rs.github.io/docs/configuration/overview/)
- [Yazi Installation](https://yazi-rs.github.io/docs/installation/)
- [Yazi Tips](https://yazi-rs.github.io/docs/tips/)
- [Yazi CLI](https://yazi-rs.github.io/docs/cli/)
