Yazi: Difference between revisions
m Minor change for stylix integration |
m remove duplicate schema in URL |
||
(12 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
Yazi is a blazing-fast terminal file manager developed in Rust, | <strong>[https://yazi-rs.github.io Yazi]</strong> is a blazing-fast terminal file manager developed in Rust, using non-blocking async I/O for an efficient, user-friendly, and highly customizable file management experience. It features full asynchronous support, distributing CPU tasks across multiple threads to maximize resource use and improve performance. | ||
It offers powerful async task scheduling with real-time progress updates, task cancellation, and internal prioritization. It supports multiple image protocols natively and integrates with [https://github.com/jstkdng/ueberzugpp Überzug++] for broad terminal compatibility. Additionally, Yazi includes built-in code highlighting and image decoding functionalities, along with a pre-loading mechanism to speed up file loading processes. | |||
== Installation == | == Installation == | ||
=== | There are several ways to install Yazi on NixOS. | ||
<syntaxhighlight lang="bash | |||
=== Temporary Shell === | |||
To temporarily use Yazi in your current shell session, run: | |||
<syntaxhighlight lang="bash"> | |||
nix-shell -p yazi | nix-shell -p yazi | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === System-wide === | ||
<syntaxhighlight lang=" | To install Yazi for all users on the system, add it to your {{ic|configuration.nix}}: | ||
<syntaxhighlight lang="nix"> | |||
programs.yazi.enable = true; | |||
</syntaxhighlight> | |||
</syntaxhighlight>After | |||
After adding the option, rebuild your system: | |||
<syntaxhighlight lang="bash"> | |||
sudo nixos-rebuild switch | sudo nixos-rebuild switch | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === Home Manager === | ||
<syntaxhighlight lang=" | To install Yazi for a single user, add it to your Home Manager configuration: | ||
<syntaxhighlight lang="nix"> | |||
programs.yazi.enable = true; | |||
</syntaxhighlight> | |||
</syntaxhighlight>After | |||
After adding the option, apply the changes: | |||
<syntaxhighlight lang="bash"> | |||
home-manager switch | home-manager switch | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Configuration == | == Configuration == | ||
As mentioned above, there are both [https://search.nixos.org/options?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=programs.yazi NixOS options] and [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.yazi.enable home-manager options] for configuring Yazi. | |||
==== | ==== Advanced ==== | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
programs.yazi = { | programs.yazi = { | ||
enable = true; | enable = true; | ||
settings = { | settings = { | ||
manager = { | manager = { | ||
ratio = [ | |||
1 | |||
4 | |||
3 | |||
]; | |||
sort_by = "natural"; | sort_by = "natural"; | ||
sort_sensitive = true; | |||
sort_reverse = false; | |||
sort_dir_first = true; | |||
linemode = "none"; | |||
show_hidden = true; | show_hidden = true; | ||
show_symlink = true; | show_symlink = true; | ||
Line 50: | Line 60: | ||
preview = { | preview = { | ||
image_filter = "lanczos3"; | image_filter = "lanczos3"; | ||
image_quality = | image_quality = 90; | ||
tab_size = 1; | |||
max_width = 600; | max_width = 600; | ||
max_height = 900; | max_height = 900; | ||
cache_dir = ""; | |||
ueberzug_scale = 1; | ueberzug_scale = 1; | ||
ueberzug_offset = [0 0 0 0]; | ueberzug_offset = [ | ||
0 | |||
0 | |||
0 | |||
0 | |||
]; | |||
}; | }; | ||
Line 62: | Line 79: | ||
bizarre_retry = 5; | bizarre_retry = 5; | ||
}; | }; | ||
}; | |||
} | |||
</syntaxhighlight> | |||
== Tips and Tricks == | |||
==== Installing Plugins ==== | |||
Many yazi plugins are [https://search.nixos.org/packages?channel=unstable&from=0&size=50&buckets=%7B%22package_attr_set%22%3A%5B%22yaziPlugins%22%5D%2C%22package_license_set%22%3A%5B%5D%2C%22package_maintainers_set%22%3A%5B%5D%2C%22package_platforms%22%3A%5B%5D%7D&sort=relevance&type=packages&query=yaziPlugins packaged in nixpkgs]. | |||
There are some additional yazi plugins packaged in the [https://github.com/lordkekz/nix-yazi-plugins nix-yazi-plugins] flake. It also provides home-manager modules for configuring the plugins' options. | |||
==== Bleeding edge ==== | |||
The upstream repository provides a flake so that Nix users can easily keep up with the bleeding edge.<ref>https://yazi-rs.github.io/docs/installation/#nix-flakes</ref><syntaxhighlight lang="nix"> | |||
inputs = { | |||
yazi.url = "github:sxyazi/yazi"; | |||
}; | |||
</syntaxhighlight>Afterwards, you can use the new package.<syntaxhighlight lang="nix"> | |||
# Global | |||
environment.systemPackages = [ yazi.packages.${pkgs.stdenv.hostPlatform.system}.default ]; | |||
# or, if you use the module | |||
programs.yazi.package = yazi.packages.${pkgs.stdenv.hostPlatform.system}.default; | |||
# Home Manager | |||
home.packages = [ yazi.packages.${pkgs.stdenv.hostPlatform.system}.default ]; | |||
# or, if you use the module | |||
programs.yazi.package = yazi.packages.${pkgs.stdenv.hostPlatform.system}.default; | |||
</syntaxhighlight>Pre-built artifacts are served at https://yazi.cachix.org, so that Nix users don't have to build Yazi on their machine.<ref>https://yazi-rs.github.io/docs/installation/#cache</ref><syntaxhighlight lang="nix"> | |||
nix = { | |||
settings = { | |||
substitute = true; | |||
substituters = [ | |||
"https://yazi.cachix.org" | |||
]; | ]; | ||
trusted-public-keys = [ | |||
"yazi.cachix.org-1:Dcdz63NZKfvUCbDGngQDAZq6kOroIrFoyO064uvLh8k=" | |||
]; | ]; | ||
}; | }; | ||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== | ==== Stylix integration ==== | ||
<syntaxhighlight lang="nix"> | |||
theme = with config.stylix.base16Scheme; { | theme = with config.stylix.base16Scheme; { | ||
filetype = { | filetype = { | ||
Line 254: | Line 144: | ||
}; | }; | ||
}; | }; | ||
</syntaxhighlight>Stylix can | </syntaxhighlight>Stylix can do it automatically for you if the following option is set:<syntaxhighlight lang="nix"> | ||
stylix.targets.yazi.enable = true; | stylix.targets.yazi.enable = true; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==== | ==== Key mapping ==== | ||
<syntaxhighlight lang="nix"> | |||
# Hyprland | |||
bind = [ | bind = [ | ||
"$mod, E, exec, kitty -e yazi" | "$mod, E, exec, kitty -e yazi" | ||
Line 266: | Line 157: | ||
== Troubleshooting == | == Troubleshooting == | ||
===RAR file extraction=== | |||
By default, yazi depends on _7zz in nixpkgs for extraction and previewing purposes. This does not support RAR files by default. To enable support, you can override the _7zz in the dependencies into unfree rar version. | |||
<syntaxHighlight lang=text> | |||
pkgs.yazi.override {_7zz = pkgs._7zz-rar; } | |||
</syntaxHighlight> | |||
== See also == | |||
*[https://search.nixos.org/options?channel=unstable&query=programs.yazi NixOS options for Yazi] | |||
*[https://yazi-rs.github.io/docs/installation/ Yazi official documentation] | |||
== References == | == References == | ||
[[Category:Applications]] | |||
[[Category:File Manager]] | |||