Setting up the Yazi file manager
After listening to the TUI challenge on the linuxunplugged podcast, I decided a file manager should be the next tool to add to my toolbelt. Other terminal enthusiasts have also blogged about customizing their file manager such that it is just right, and I wanted to see what all the fuss was about.
Yazi versus Ranger
Ranger is the tried and true classic favourite. With a first stable release in 2009, it has stood the test of time and still is more than capable today. However, it was a bit slow, and having to use :touch
to create a file didn’t feel right, I wanted hotkeys like a
for adding a new file (fans of ranger, I am sure there is a way to customize it to do this, I just didn’t give it the time). Vim support for both feels first-class. I was excited about the integration of zoxide and ripgrep with yazi, and the development velocity of yazi is incredible. While I use Alacritty, which doesn’t support image rendering, for those that use something like Kitty comparing the speed and definition at which ranger and yazi render images might be of interest.
Installing Yazi
Yazi is fairly new on the block, which means that it isn’t in Debian stable yet (though Debian 13 is right around the corner!). If you absolutely want to install it through a .deb
you may be interested in yazi-debian. To install, I used cargo, as this was something that I already have setup and configured[1]. For a full list of installation options, check the documentation.
cargo install yazi-fm yazi-cli
Configuration and integration choices
These are some changes that I made to yazi so that it better fit in with other elements of my setup. You will likely find some of these helpful, but not all of them will make sense for you.
Catppuccin mocha colours
This was easy—there is a yazi port available. The instructions under “Usage” are straightforward. Take the extra step to also have syntax highlighting in the preview, it is just one more file to copy and worth it.
Switch keybindings
Yazi allows you to customize the keybindings via keymap.toml
in the yazi configuration directory (~/.config/yazi
by default). I made the following changes from the default keymap.toml.
- There are a series of “go” commands, basically shortcuts to get to popular directories. I switched
gc
from "cd~/.config
to~/dotfiles
since that is where I manage my configuration files. I also added a new bindinggt
to “go tmp” (/tmp
). For a great overview on why and how you can use the tmp directory on linux, see this great blog post by Marc. - Switch the help keybinding from
~
(not sure why that was picked…) to?
. There is a default option on?
that I really didn’t see myself using, so it got replaced. - Search with ripgrep is configured to
S
by default, and zoxide is onZ
. I scrapped the commands that were occupying lowercase defaults and just made ripgrep and zoxide the star players on the lowercase keybindings.
Show hidden files by default
While most users won’t need to work with hidden files all the time, for those that code many important files follow the hidden file syntax, such as .gitignore
or the .config
directory. Therefore, I used the following to always show hidden files, without having to use .
.
# yazi.toml
[mgr]
show_hidden = true
Using Yazi from within Neovim
Previously, I had been using nvim-tree to quickly switch files while in Neovim. However, I didn’t want to have to learn two sets of keybindings for file navigation[2]. I found a simple yazi neovim plugin that has worked perfectly. I opted to keep the key mapping from nvim-tree (<Leader>e
) to open yazi and it is snappy! No noticeable pause which is critical for a motion I will likely be doing thousands of times.
Conclusion
After using yazi for about a week, I don’t really have any pain points! I see this sticking around for a long time! If you would like to see my yazi configuration at any point in the future, it will be here.
Cargo-update is a great tool to keep all your crates updated. ↩︎
Wherever possible, the trick to get keybindings to stick is to use similar keybindings to do similar things across tui apps. Make the apps fit your preferences, that’s the beauty of customization and not something that you will get with many commercial apps. ↩︎