New favorite file manager

Posted on Jan 17, 2024

I recently started using tuifi as a file browser, but after configuring yazi I think I like it better. First, it is more than a basic tui file manager. It has image and document previews, clear and powerful configuration, plus it is wicked fast.

I discovered yazi from Terminal Trove, a website dedicated to commandline applications. It even has an RSS feed, which makes it so new terminal applications show up in my feed reader every week.

What has sold me on yazi are all the additional features. For example, it shows image previews while navigating through folders. It also shows file previews and will open in your file editor of choice. Plus it integrates with nerd-fonts to show file icons and symbols.

Overall it is surprisingly fast and is probably my favorite file manager on all systems, graphical or commandline. It is so much faster navigating directories than a graphical file manager and the previews load faster, too.

It is worth checking out as setup should take just a few minutes. Here is how I have it setup on my Debian 12 system.

Setup

Prerequisites for installing on Debian:

sudo apt install file ffmpegthumbnailer unar jq poppler-utils fd-find fzf zoxide ripgrep

Next, I am using yazi from their releases page as they do not have a build for Debian. This is a run-in-place binary that can be placed anywhere in your $PATH. For that I need to manually manage, I always place them in /home/$USER/bin and then add it to my $PATH.

Fonts

We also need to have a nerd-font installed. I am already using a nerd-font for both tilda and kitty, so not an issue. The font I am using is SpaceMono Nerd Font Mono. Download a font and place in ~/.fonts to be available.

I also downloaded and configured the Symbols Nerd Font and placed into my font directory for use with programs like yazi.

fish shell function

There is a function that needs to be added to stay in the current working directory after browsing in yazi. I use fish, so run this command:

function ya
	set tmp (mktemp -t "yazi-cwd.XXXXX")
	yazi $argv --cwd-file="$tmp"
	if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
		cd -- "$cwd"
	end
	rm -f -- "$tmp"
end

Viewing images

My default terminal emulator on Debian desktops is Tilda, which does not support displaying images in the terminal by default. In order to get this working, we need to install ueberzug++. Install on Debian 12 with this:

$ echo 'deb http://download.opensuse.org/repositories/home:/justkidding/Debian_12/ /' | sudo tee /etc/apt/sources.list.d/home:justkidding.list

$ curl -fsSL https://download.opensuse.org/repositories/home:justkidding/Debian_12/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_justkidding.gpg > /dev/null

$ sudo apt update
$ sudo apt install ueberzugpp

tmux config

Last is tmux. To have image previews shown correctly in tmux, add this to your tmux config file:

set -g allow-passthrough on

set -ga update-environment TERM
set -ga update-environment TERM_PROGRAM

- - - - -

Did you like this post? Give it an upvote by clicking on the arrows below! Sending me an upvote is like you and I giving each other a high five.

🙏 😎

Thank you for reading! If you would like to comment on this post you can start a conversation on the Fediverse. Message me on Mastodon at @cinimodev@masto.ctms.me. Or, you may email me at blog.discourse904@8alias.com. This is an intentionally masked email address that will be forwarded to the correct inbox.

If you enjoy the random stuff I write here, post to Mastodon, or watch on YouTube, and are feeling generous, I am open to tips of Ko-fi.