Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing HM-Modules #15

Open
5 tasks
Mcrtin opened this issue Jan 24, 2025 · 4 comments
Open
5 tasks

Missing HM-Modules #15

Mcrtin opened this issue Jan 24, 2025 · 4 comments

Comments

@Mcrtin
Copy link

Mcrtin commented Jan 24, 2025

  • copy-file-contents
  • exifaudio
  • glow
  • ouch
  • rich-preview

These plugins are still missing home-manager modules.
Is this because they need previewers/openers?

@lordkekz
Copy link
Owner

No, it's just that they were added while the PR #9 was already open so their modules weren't included right away.

You can send a PR to add modules for them if you feel like it, otherwise I'll do it eventually.

@haennes
Copy link
Contributor

haennes commented Jan 24, 2025

I currently dont have much time. Will be free again starting at the 12th of February, that´s when I will probably make these modules.
@Mcrtin I have however already searched and found examples of people using the plugin in nix, and compiled a very unstructured list of things that should be in the module. If you want to have this mess of a writeup as reference just ping me here.

@Mcrtin
Copy link
Author

Mcrtin commented Jan 25, 2025

@haennes sure, why not. I don't know if I can get myself to write these modules though

@haennes
Copy link
Contributor

haennes commented Jan 25, 2025

There you go, just a wild mess copy and pasted together from different github repos.
FYI:
found these using this search
and then looked around to find where they configure yazi.

--NOTE: for the copy-file-contents plugin:
                require("copy-file-contents"):setup({
        	clipboard_cmd = "default",
        	append_char = "\n",
        	notification = true,
        })

previewers = {
          prepend = [
            {
              mime = "application/zip"; # Removed x- prefix
              run = "ouch";
            }
            {
              mime = "application/tar"; # Removed x- prefix
              run = "ouch";
            }
            {
              mime = "application/bzip2"; # Removed x- prefix
              run = "ouch";
            }
            {
              mime = "application/7z-compressed"; # Removed x- prefix
              run = "ouch";
            }
            {
              mime = "application/rar"; # Removed x- prefix
              run = "ouch";
            }
            {
              mime = "application/xz"; # Removed x- prefix
              run = "ouch";
            }
          ];
        };

plugin = {
          prepend_previewers = [
            {
              #NOTE: https://github.com/Reledia/glow.yazi
              name = "*.md";
              run = "glow";
            }
            {
              #NOTE: https://github.com/Sonico98/exifaudio.yazi
              mime = "audio/*";
              run = "exifaudio";
            }
            {
              #NOTE: https://github.com/AnirudhG07/rich-preview.yazi
              name = "*.csv";
              run = "rich-preview";
            }
            {
              name = "*.rst";
              run = "rich-preview";
            }
            {
              name = "*.ipynb";
              run = "rich-preview";
            }
            {
              name = "*.json";
              run = "rich-preview";
            }

          ];
        };
      };

#NOTE:  https://github.com/AnirudhG07/plugins-yazi/tree/main/copy-file-contents.yazi
            {
              on = [
                "c"
                "C"
              ];
              run = [ "plugin copy-file-contents" ];
              desc = "Copy contents of file";
            }

#NOTE:  https://github.com/ndtoan96/ouch.yazi
            # ya pack -a ndtoan96/ouch
            {
              on = [
                "c"
                "Z"
              ];
              run = [ "plugin ouch --args=zip" ];
              desc = "Zip the selected files";
            }

programs.yazi = {
      # https://github.com/orhnk/system-clipboard.yazi
      keymap.manager.prepend_keymap = [
        {
          on = "<C-y>";
          run = [ "plugin system-clipboard" ];
          desc = "Copy selected files to system clipboard";

        }
      ];
    };

copy file contents options


{
          on = ["i"];
          run = "plugin --sync hide-preview";
          desc = "Hide or show preview pane.";
        }
        {
          on = ["I"];
          run = "plugin --sync max-preview";
          desc = "Maximize or restore preview.";
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants