mirror of
https://github.com/yukimura1227/vim-yazi.git
synced 2026-06-21 00:21:15 -06:00
Vim plugin integrating the Yazi file manager for seamless in-editor file browsing and navigation.
- Vim Script 100%
|
|
||
|---|---|---|
| assets | ||
| autoload | ||
| doc | ||
| plugin | ||
| LICENSE | ||
| README.md | ||
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
Requirements
- Vim 8.0+ or Neovim 0.4+
- yazi installed and available in PATH
Installation
Using vim-plug
Plug 'yukimura1227/vim-yazi'
Manual Installation
- Download the plugin file
- Place it in your Vim plugin directory:
- Vim:
~/.vim/plugin/vim-yazi - Neovim:
~/.config/nvim/plugin/vim-yazi
- Vim:
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
- When you run a yazi command, the plugin launches yazi with a temporary file for storing selections
- Navigate and select files in yazi (use
Spaceto select,Enterto confirm) - Upon exiting yazi, the plugin reads the selection file and opens the chosen files in Vim
- Multiple files are opened as separate buffers when
g:yazi_open_multipleis 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:
- Make sure yazi is installed:
yazi --version - Check if yazi is in your PATH:
which yazi - 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
Spaceand confirming withEnter - 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
