summaryrefslogtreecommitdiffstats
path: root/modules/plugins/utility/yazi-nvim/yazi-nvim.nix
blob: 3f44e48ce4c22b440a86614f739492a6259250d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
  config,
  lib,
  ...
}: let
  inherit (lib.options) mkEnableOption mkOption;
  inherit (lib.types) bool;
  inherit (lib.nvim.types) mkPluginSetupOption;
  inherit (config.vim.lib) mkMappingOption;
in {
  options.vim.utility.yazi-nvim = {
    enable = mkEnableOption ''
      companion plugin for the yazi terminal file manager [yazi-nvim]
    '';

    mappings = {
      openYazi = mkMappingOption "Open yazi at the current file [yazi.nvim]" "<leader>-";
      openYaziDir = mkMappingOption "Open the file manager in nvim's working directory [yazi.nvim]" "<leader>cw";
      yaziToggle = mkMappingOption "Resume the last yazi session [yazi.nvim]" "<c-up>";
    };

    setupOpts = mkPluginSetupOption "yazi-nvim" {
      open_for_directories = mkOption {
        type = bool;
        default = false;
        description = "Whether to open Yazi instead of netrw";
      };
    };
  };
}