Wednesday, July 3, 2024

Yazi: a swiss-army utility, for multiple platforms

 I have been using Manjaro for years, now.  Every so often I contemplate installing Arch, which I like, which is not polluted by Manjaro-specific tweaks; but (1) in spite of assurances, it is problematic to install; and (2) none of the other Arch-based distributions have worked well for me.  

Today I want to mention and recommend Yazi, a text/terminal-based "file manager," similar to ranger and a few clones of ranger.  Yazi is, in most respects, the best of the breed.  Yazi, with a few tweaks and some steep uphill learning, made short work of  culling some 150GB of images.  No other tool has been as efficient.   For me.

The home page for Yazi may be found here.

Configuration

Here is where I mention the steep learning curve.  The usage of this tool was not immediately apparent to me.  This is probably on me; eventually, I found the keybindings in the Quick Start page on Yazi's home page.  Not all of the key strokes were either easily understood, or found.  On my MacBook, the color of my terminal interfered with those of Yazi, so I had to read further, and learn to install a theme; the concept and terminology of themes in Yazi were not intuitive.  For me.  Once I figured out how, it was possible to install a theme in the configuration file; various config files are located at ~/.config/yazi.  

 Previewing images

I was able to view images as soon as I had installed yazi on both the macbook and my linux desktop.  But the image was a little small.  I found a couple of things that helped: I learned I could edit the configuration file that determined the maximum image width; after that, the system ran a triffle slower, but I could see the images.  A plugin called "max-preview" enabled expanding the preview even further, in some cases.  I won't explain.  More information is available on the image-preview page of Yazi's home page.

Previewing works nicely on the kitty terminal emulator.  I like kitty, because, out of the box, it is fast, and has a stark black background and intense coloration of text. 


 Bookmarks

Ranger allows definition of keybindings in a more intuitive way (to me) that enabled me to define keystrokes to jump to certain folders/directories that I used frequently.  I just learned to three bookmarking plugins for Yazi that enable something similar, and at least good enough.  bookmarks-persistent, and bookmarks

More information on plugins can be found here.

After all that

 A rabbit hole was involved.  But along the way I learned about several other tools that, amazingly, integrate seamlessly (sort of) with Yazi: fzf, zoxide, ripgrep, fd and others.  This is a remarkably polished tool, for a package that has been undergoing rapid and apparently continuous development.  


I recommend installing the development version, which is the default version of yazi in the Arch ecosystem's AUR repository.  This enables some of the more advanced tools.


Fortunately , ranger, a tool I have used for years to browse and sort files and directories, does not work anymore---at least easily---for previewing images and PDFs.  In desperation I reached out to Mr. Google, and discovered a few others.  Nnn is unworkable.  I has never worked out of the box, which was a show stopper for me.  Some others exist.  Yazi appeared out of the mists, and answered my call....  

For now, links on the website of Yazi---a site that is well laid out---point to more information about plugins and other vagaries. 


 

No comments:

The Free Software Foundation (FSF) is a beacon

I just stumbled upon a statement on the website of the FSF ( fsf.org ) about the appointment of three new board members of the organisation....