Yazi file manager

For file management we usually use the file manager integrated into the OS, such as Nemo, Dolphin, Thunar, etc. These file managers are GUI-based and therefore provide a nice, easy to use user interface with a toolbar and a right-click context menu.

There are also terminal-based file managers, which at 1st sight might be offputting as you don’t get that familiar GUI. However, recently I discovered Yazi – here is its Github page: https://github.com/sxyazi/yazi. To get a quick overview of what it looks like and what you can do with it, here is a 10 min. YouTube video: https://www.youtube.com/watch?v=RgV47l59NYs.

Using Yazi will make you workflow smoother, more efficient. If you really want to go 1 level up, you can also install zoxide (I have) – https://github.com/ajeetdsouza/zoxide – and give that work speed an extra boost. Yazi and zoxide work hand-in-glove.

You can open a file from within Yazi by selecting the file and clicking enter. As with your GUI file manager, you expect the file to be opened in its default app. For Yazi to do that you need to fine-tune its config file: ~/.config/yazi/yazi.toml.

There is an [opener] edit part, which can by amended like so:

[opener]
vscodium_md = [
  { run = "vscodium \"$@\" &", desc = "vscodium (Markdown)", block = false, for = "unix", match = "*.md" }
]
kwrite_txt = [
  { run = "nohup kwrite \"$@\" > /dev/null 2>&1 &", desc = "kwrite (Text)", block = false, for = "unix", match = "*.txt", orphan = true }
]
thunderbird_eml = [
  { run = "nohup thunderbird \"$@\" &", desc = "Thunderbird (Email)", block = false, for = "unix", match = "*.eml" }
]
system_default = [
  { run = "xdg-open \"$1\"", desc = "System Default", for = "linux" }
]

Obviously, in the above code you can add/delete apps as per your use case.

Below the [opener] setion there is a section with open, rules, which can be amended as follows:

[open]
rules = [
  { name = "*.eml", use = [ "thunderbird_eml" ] },
  { name = "*.md", use = [ "vscodium_md" ] },
  { name = "*.txt", use = [ "kwrite_txt" ] },
  { mime = "application/pdf", use = [ "system_default" ] },
  { mime = "image/*", use = [ "system_default" ] },
  { mime = "{audio,video}/*", use = [ "system_default" ] },
  { name = "*", use = [ "system_default" ] }
]

It took me a couple of says to figure this out, so I wanted to share this with you in case you are inetersted in Yazi. Happy file managing :grinning_face:

Switched to yazi from lf quite a while ago. Love it, rarely open Dolphin any more.

1 Like

:rightwards_hand: :leftwards_hand:

Yazi is up and running 24/7 in an dedicated kitty instance on my machine.
Bottom left, non variable window, fixed in place with some window rules.

Has been a PITA initially to get ueberzugpp to work for displaying images inline,
but mostly due to inexpierence from my side.

1 Like

Like you, in order to get images rendered I had to move to to Kitty. Unlike you, I did not have to do anything else, the image were rendered that way.

There have been a lot of changes in the past 10 months.

Just learned that ya pack is outdated and was replaced with ya pkg for instance.
And my yazi.toml needs an general overhaul as it seems like. But it works.

Didn’t know that. There are definitely lots of changes, and sometimes it would be nice to know a little toml, which I’ve struggled with. Most apps don’t make changes that require the user to make a bunch of little changes in the configs.

It’s not that hard to get into toml. For the specific plugins yazi has to offer, the tomls are pretty well documented and their sites provide the required snippets how to set it up correctly.

In love with the idea of a cli file manager. ga-ga actually. there’s a whimsical (some call it knucklehead) part of me that reserves the right to right-click/open with anything I want so I am a commitment-phobe about picking all my default apps; not most, just some.

I need a linux shrink probably

does it have dual directory view like mc?

Running mc (or NortonCmd) for >30years now. It runs on any platform, mainframe till embedded… And textbased or graphical doesnt matter. Can run local or remote, any filesystem. Cannot imagine anything better…

1 Like

Check out the vid on https://github.com/sxyazi/yazi

Well it’s not like mc(not sure what multi tab support means for yazi), I’m used to having two directories side by side, to see contents. In the video, the panels overlap. Also it looks like vim, you need to learn keyboard combinations to be fast with it, lack of menus and buttons makes it harder to use for the average user.

Seems like a powerful file manager, but not for everyone, just like vim.