2025-10-16

Yazi — Vim and PowerShell File Manager

Yazi is a terminal-based file manager written in Rust. In this blogpost, we explore how to use Yazi as Vim’s file manager in place of the built-in netrw. While Yazi is still under active development, it already offers an impressive range of features including fast performance, file previews, and a clean, keyboard-focused interface.

Integrating Yazi with Vim Using Vim9script

To kick things off, we downloaded the precompiled Yazi binary for Windows from its GitHub releases page. This gave us a lightweight, blazing-fast terminal file manager ready to be embedded into our workflow.

We then crafted a custom Vim9script to seamlessly integrate Yazi into Vim. This script introduces a convenient command that lets you open and edit your yazi.toml, keymap.toml, and other configuration files directly from within Vim—no need to leave your editor.

Most of Yazi’s dependencies—like rg (ripgrep), fzf, and zoxide—were already installed either via platform-specific binaries or through the Mingw-w64 subsystem, making setup smooth and minimal.

As shown in the video below, we ran:

   yazi.exe --debug

This revealed which tools Yazi supports on our system—like image previews, plugins, and external utilities (rg, fzf, zoxide).

We then cloned the Vim plugin into our local runtime/pack directory and sourced it using the :packadd command. This setup adds a handy shortcut (leader>e) to launch Yazi directly from Vim.

It also introduces three custom commands:

  • YaziConfig — opens yazi.toml
  • YaziKeymap — opens keymap.toml
  • YaziTheme — opens your theme configuration

These commands make it effortless to tweak Yazi’s behavior without leaving the text editor.

As a Temu Affiliate I earn from qualifying purchases

In this example, we used the yazi.toml and keymap.toml files shown below.

  • yazi.toml is Yazi’s main configuration file. It defines core behavior—like UI layout, preview settings, plugin loading, and system integration. You can tweak it to customize how Yazi looks and responds.
    [mgr]
    ratio          = [ 2, 3, 5 ]
    show_hidden = true
    reverse_sort = false
    title_format   = "Yazi: {cwd}"

    [preview]
    max_width  = 600
    max_height = 800
    

    [opener]
    open = [
        { run = '"C:\\Users\\Seve\\workspace\\toolbox\\bin\\SumatraPDF.exe" %*', desc = "Open PDF", for = "windows" },
    ]
    run = [
        { run = "powershell.exe -c py %*", desc="Python", block = true, interactive = true, for = "windows" },
    ]

    edit = [
        { run = "C:\\Users\\Seve\\Vim\\vim90\\vim.exe %*", desc="Vim", block = true, for = "windows" },
    ]
    [open]
    rules = [
        { name = "*.py", use =["edit", "run"] },

    ]

    [input]
    cursor_blink = true
  • keymap.toml handles keyboard shortcuts. It maps keys to actions like opening files/shell terminal or navigating directories.
    [[mgr.append_keymap]]
    on   = "!"
    for  = "windows"
    run  = 'shell "powershell.exe" --block'
    desc = "Open PowerShell here"

    [[manager.prepend_keymap]]
    on = "%" 
    for = "windows"
    run = 'shell "powershell.exe -c py $0" --confirm'
    desc = "Run python script"

Together, these TOML files give you full control over Yazi’s interface and interaction style.

Enabling Icons with Nerd Font

To unlock rich icons for file types and directories in Yazi, we installed the Atkinson Mono Nerd Font' and set it as the font face in Windows Terminal.

After installing the font, go to:

   Windows Terminal → Settings → Appearance

Make sure to check the box “Show all fonts” if it doesn’t appear in the list. Once selected, Yazi will display a variety of icons—making navigation more visual and intuitive.