yazi

yazi

CLIファイラーに何かいいものがないか探していたところyaziを見つけた。

GitHub - sxyazi/yazi: 💥 Blazing fast terminal file manager written in Rust, based on async I/O.
💥 Blazing fast terminal file manager written in Rust, based on async I/O. - sxyazi/yazi
GitHub - sxyazi/yazi: 💥 Blazing fast terminal file manager written in Rust, based on async I/O. faviconhttps://github.com/sxyazi/yazi
GitHub - sxyazi/yazi: 💥 Blazing fast terminal file manager written in Rust, based on async I/O.

残念ながらARMv7用は存在しないもののそれ以外のアーキテクチャ(aarch64等)には対応していた。

yaziのインストール(snap)

Installation | Yazi
How to install Yazi on various operating systems.
Installation | Yazi faviconhttps://yazi-rs.github.io/docs/installation/

Ubuntuではcargoでインストールするようになっているが面倒なのでsnapでインストールする。

sudo snap install yazi --classic

yaziのテーマ

Flavors (BETA) | Yazi
Learn how to use Yazi flavors.
Flavors (BETA) | Yazi faviconhttps://yazi-rs.github.io/docs/flavors/overview

~/.config/yazi/flavors/以下にテーマフォルダを置く。

githubにあるテーマはya pack -a kmlupreti/ayu-darkのようにコマンドでインストールすることができる。

コマンドが存在しない場合、直接~/.config/yazi/flavorsフォルダ内にgit cloneする。(git cloneもダメなら直接ダウンロードして配置する)

~/.config/yazi/theme.tomlにテーマ名を入力。

[flavor]
dark = "catppuccin-mocha"
light = "catppuccin-mocha"

yaziの画像表示

Image Preview | Yazi
How to preview images in Yazi.
Image Preview | Yazi faviconhttps://yazi-rs.github.io/docs/image-preview

tmuxの場合~/.tmux.confに以下を追記する。

set -g allow-passthrough on
set -ga update-environment TERM
set -ga update-environment TERM_PROGRAM

fishでyaziを起動するときのスクリプト

Quick Start | Yazi
A quick guide on the basic usage of Yazi.
Quick Start | Yazi faviconhttps://yazi-rs.github.io/docs/quick-start

yaziを閉じたときにその現在位置へ自動的にcdするようにするためのスクリプト~/.config/fish/functions/以下に配置する。(function名とファイル名は一致させる: ya → ya.fish)

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