Vim plugin integrating the Yazi file manager for seamless in-editor file browsing and navigation.
  • Vim Script 100%
Find a file
yukimura1227 ce412ec07b
Merge pull request #2 from moriyoshi-kasuga/main
fix: correct behavior of YaziOpen with empty arguments (and add YaziCwd command)
2025-07-30 01:25:03 +09:00
assets docs: refine vim-yazi-logo.png 2025-07-11 01:11:02 +09:00
autoload fix: correct behavior of YaziOpen with empty arguments 2025-07-18 10:47:46 +09:00
doc docs: document new :YaziCwd command and clarify :Yazi behavior 2025-07-20 11:48:35 +09:00
plugin feat: introduce YaziCwd as a shortcut for Yazi . 2025-07-18 11:15:33 +09:00
LICENSE Initial commit 2025-07-02 21:08:34 +09:00
README.md docs: document new :YaziCwd command and clarify :Yazi behavior 2025-07-20 11:48:35 +09:00

vim-yazi logo

vim-yazi

A Vim plugin that integrates the yazi terminal file manager with Vim/Neovim.

Features

  • 🚀 Launch yazi file manager from within Vim/Neovim
  • 📁 Open selected files in Vim buffers automatically
  • 🎯 Support for opening multiple files at once
  • 🔄 Optional netrw replacement
  • Works with both Vim 8+ and Neovim

vim-yazi-sample

Requirements

  • Vim 8.0+ or Neovim 0.4+
  • yazi installed and available in PATH

Installation

Using vim-plug

Plug 'yukimura1227/vim-yazi'

Manual Installation

  1. Download the plugin file
  2. Place it in your Vim plugin directory:
    • Vim: ~/.vim/plugin/vim-yazi
    • Neovim: ~/.config/nvim/plugin/vim-yazi

Usage

Commands

Command Description
:Yazi [path] Launch yazi in the specified directory (defaults to current file's directory)
:YaziCwd Launch yazi in the current working directory (equivalent to :Yazi .)

Default Key Mappings

Key Action
<leader>y Launch yazi

Configuration

Add these options to your .vimrc or init.vim to customize the plugin:

" Path to yazi executable (default: 'yazi')
let g:yazi_executable = 'yazi'

" Enable opening multiple files (default: 1)
let g:yazi_open_multiple = 0

" Replace netrw with yazi (default: 0)
let g:yazi_replace_netrw = 1

" Disable default key mappings (default: 0)
let g:yazi_no_mappings = 1

Custom Key Mappings

If you prefer custom key mappings, disable the defaults and define your own:

" Disable default mappings
let g:yazi_no_mappings = 1

" Define custom mappings
nnoremap <silent> <C-n> :Yazi<CR>

How It Works

  1. When you run a yazi command, the plugin launches yazi with a temporary file for storing selections
  2. Navigate and select files in yazi (use Space to select, Enter to confirm)
  3. Upon exiting yazi, the plugin reads the selection file and opens the chosen files in Vim
  4. Multiple files are opened as separate buffers when g:yazi_open_multiple is enabled

Examples

Basic Usage

" Open yazi in current file's directory
:Yazi

" Open yazi in a specific directory
:Yazi ~/Documents

Advanced Configuration

" Custom configuration example
let g:yazi_executable = '/usr/local/bin/yazi'
let g:yazi_replace_netrw = 1
let g:yazi_no_mappings = 1

" Custom key mappings
nnoremap <silent> <F2> :Yazi<CR>

Troubleshooting

Yazi not found

If you get an error about yazi not being found:

  1. Make sure yazi is installed: yazi --version
  2. Check if yazi is in your PATH: which yazi
  3. Set the full path in your configuration: let g:yazi_executable = '/full/path/to/yazi'

Files not opening

  • Make sure you're selecting files in yazi with Space and confirming with Enter
  • Check that the files you're selecting are readable
  • Verify the temporary directory is writable

Contributing

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

License

This plugin is released under the MIT License. See LICENSE for details.

Acknowledgments

  • yazi - The blazingly fast terminal file manager
  • Inspired by similar file manager integrations in the Vim ecosystem