Yazi: Difference between revisions

Layer-09 (talk | contribs)
Yazi has changed some of its syntax, which broke the advanced configuration.
Mention where to find yazi plugins.
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
'''Yazi'''<ref>https://yazi-rs.github.io/</ref> is a '''blazing-fast''' terminal file manager developed in '''Rust''', using '''non-blocking async I/O''' for an efficient, user-friendly, and highly customizable experience. It features '''full asynchronous support''', distributing CPU tasks across multiple threads to maximize resource use and improve '''performance'''.
<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 '''Ü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.
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 ==
Line 11: Line 11:


==== Using global configuration ====
==== Using global configuration ====
<syntaxhighlight lang="text">
<syntaxhighlight lang="nix">programs.yazi = {
environment.systemPackages = [
  enable = true;
  pkgs.yazi
  # There are more options available:
];
  # https://search.nixos.org/options?channel=unstable&type=packages&query=programs.yazi
</syntaxhighlight>After modifying your configuration, apply the changes by running:<syntaxhighlight lang="bash">
};</syntaxhighlight>After modifying your configuration, apply the changes by running:<syntaxhighlight lang="bash">sudo nixos-rebuild switch</syntaxhighlight>
sudo nixos-rebuild switch
</syntaxhighlight>


==== Using home configuration ====
==== Using home configuration ====
<syntaxhighlight lang="text">
<syntaxhighlight lang="nix">programs.yazi = {
home.packages = [
  enable = true;
   pkgs.yazi  
   # There are more options available:
];
  # https://nix-community.github.io/home-manager/options.xhtml#opt-programs.yazi.enable
</syntaxhighlight>After updating your configuration, apply the changes by running:<syntaxhighlight lang="bash">
};</syntaxhighlight>After updating your configuration, apply the changes by running:<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.


==== Basic ====
==== Advanced Example ====
<syntaxhighlight lang="nix">
programs.yazi = {
    enable = true;
};
</syntaxhighlight>
 
==== Advanced ====
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
programs.yazi = {
programs.yazi = {
Line 43: Line 35:
   settings = {
   settings = {
     manager = {
     manager = {
       layout = [
       ratio = [
         1
         1
         4
         4
Line 88: Line 80:
The home manager options are defined in the following [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.yazi.enable Home Manager Options Manual].
The home manager options are defined in the following [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.yazi.enable Home Manager Options Manual].


The system-wide options are listed on [https://mynixos.com/search?q=yazi MyNixOS].
The system-wide options are listed on {{nixos:option|programs.yazi.*}}.
 
==== 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 ====
==== Bleeding edge ====
Line 95: Line 92:
     yazi.url = "github:sxyazi/yazi";
     yazi.url = "github:sxyazi/yazi";
};
};
</syntaxhighlight>Afterwords, you can use the new package.<syntaxhighlight lang="nix">
</syntaxhighlight>Afterwards, you can use the new package.<syntaxhighlight lang="nix">
# Global
# Global
environment.systemPackages = [ yazi.packages.${pkgs.system}.default ];
environment.systemPackages = [ yazi.packages.${pkgs.system}.default ];
# or, if you use the module
programs.yazi.package = yazi.packages.${pkgs.system}.default;


# Home Manager
# Home Manager
home.packages = [ yazi.packages.${pkgs.system}.default ];            
home.packages = [ yazi.packages.${pkgs.system}.default ];
# or, if you use the module
programs.yazi.package = yazi.packages.${pkgs.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">
</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 = {
nix = {