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. favicon https://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 favicon https://yazi-rs.github.io/docs/installation/
Installation | Yazi

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

Terminal window
sudo snap install yazi --classic

yaziのテーマ

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

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

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

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

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

~/.config/yazi/theme.toml
[flavor]
dark = "catppuccin-mocha"
light = "catppuccin-mocha"

yaziの画像表示

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

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

~/.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 favicon https://yazi-rs.github.io/docs/quick-start
Quick Start | Yazi

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

~/.config/fish/functions/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