{"id":16605820,"url":"https://github.com/jedahan/zr","last_synced_at":"2025-04-08T06:34:38.740Z","repository":{"id":41160114,"uuid":"89022591","full_name":"jedahan/zr","owner":"jedahan","description":"zsh plugin manager written in rust","archived":false,"fork":false,"pushed_at":"2024-12-10T20:23:34.000Z","size":364,"stargazers_count":186,"open_issues_count":3,"forks_count":11,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-06T16:54:09.244Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jedahan.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-21T20:50:18.000Z","updated_at":"2025-03-19T15:07:04.000Z","dependencies_parsed_at":"2024-03-31T16:26:31.541Z","dependency_job_id":"a4f1689c-b428-40f1-a82e-76e5b1bd5f17","html_url":"https://github.com/jedahan/zr","commit_stats":{"total_commits":136,"total_committers":9,"mean_commits":15.11111111111111,"dds":"0.17647058823529416","last_synced_commit":"05f9b2d88ff7a59b9412e7fece419366e906a672"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedahan%2Fzr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedahan%2Fzr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedahan%2Fzr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedahan%2Fzr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jedahan","download_url":"https://codeload.github.com/jedahan/zr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247792635,"owners_count":20996890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T01:01:48.091Z","updated_at":"2025-04-08T06:34:38.723Z","avatar_url":"https://github.com/jedahan.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"zrat.png\" alt=\"zrat\" title=\"zrat\" width=120 /\u003e\n\n### zr(at)\n\nnimble zsh plugin manager\n\n    zr 1.2.1\n    by Jonathan Dahan \u003chi@jonathan.is\u003e\n\n    Example\n\n    . \u003c(zr geometry-zsh/geometry junegunn/fzf.git/shell/key-bindings.zsh)\n\n    Format\n\n    zr author/name                                    *.zsh from github.com/author/name\n    zr author/name/file.zsh                        file.zsh from github.com/author/name\n    zr https://gitlab.com/a/plugin                    *.zsh from gitlab.com/a/plugin\n    zr https://gitlab.com/a/plugin.git/file.zsh    file.zsh from gitlab.com/a/plugin\n\n    Commands\n\n    zr +update                                      update plugins from already sourced zsh\n    zr +help                                        show help\n\n#### install\n\n`zr` is published to crates.io, and can be installed with `cargo install zr`\n\n#### usage\n\nAdd this to your *~/.zshrc*:\n\n```zsh\n. \u003c(zr frmendes/geometry junegunn/fzf.git/shell/key-bindings.zsh)\n```\n\nA bit more complex example, that only generates when .zshrc has been updated:\n\n```zsh\n# Generate new ~/.config/zr.zsh if it does not exist or if ~/.zshrc has been changed\nif [[ ! -f ~/.config/zr.zsh ]] || [[ ~/.zshrc -nt ~/.config/zr.zsh ]]; then\n  zr \\\n    frmendes/geometry \\\n    jedahan/geometry-hydrate \\\n    junegunn/fzf.git/shell/key-bindings.zsh \\\n    \u003e ~/.config/zr.zsh\nfi\n\nsource ~/.config/zr.zsh\n```\n\n#### identifiers\n\n`zr` supports four identifier formats. The last format requires `.git` as a delimeter.\n\nformat                                     | resolves to\n-------------------------------------------|-----------\n`author/name`                              | __*.zsh__ from https://github.com/author/name\n`author/name/file.zsh`                     | __file.zsh__ from https://github.com/author/name\n`https://gitlab.com/a/plugin`              | __*.zsh__ from https://gitlab.com/a/plugin\n`https://gitlab.com/a/plugin.git/file.zsh` | __file.zsh__ from https://gitlab.com/a/plugin.git. The `.git` is used as a delimeter, and is required.\n\n#### speed\n\nThe following two benchmarks show on a 2024 14\" macbook pro m4\n* it takes 10ms to generate a sourceable script from a dozen or so repos\n* it takes an additional 30ms for zsh to load said script\n\n```zsh\n$ hyperfine --warmup 3 \\\n  --command-name \"generate shell script\" \\\n    'zsh -d -f -l -c \"source benchmark.zsh \u0026\u0026 zrinit \u0026\u0026 exit\"' \\\n  --command-name \"generate and load shell script\" \\\n    'zsh -d -f -l -c \"source benchmark.zsh \u0026\u0026 . \u003c(zrinit) \u0026\u0026 exit\"'\n\nBenchmark 1: generate shell script\n  Time (mean ± σ):       8.2 ms ±   1.3 ms    [User: 3.4 ms, System: 3.7 ms]\n  Range (min … max):     7.2 ms …  12.1 ms    258 runs\n\nBenchmark 2: generate and load shell script\n  Time (mean ± σ):      42.1 ms ±   2.6 ms    [User: 22.4 ms, System: 58.2 ms]\n  Range (min … max):    38.7 ms …  51.2 ms    54 runs\n```\n\n```zsh\n# benchmark.zsh\nfunction zrinit {\n  XDG_CACHE_HOME=/tmp/zrbenchmark zr sorin-ionescu/prezto.git/modules/git/alias.zsh \\\n    sorin-ionescu/prezto.git/modules/history/init.zsh \\\n    junegunn/fzf.git/shell/key-bindings.zsh \\\n    zsh-users/zsh-autosuggestions \\\n    zdharma/fast-syntax-highlighting \\\n    molovo/tipz \\\n    geometry-zsh/geometry \\\n    jedahan/geometry-hydrate \\\n    jedahan/geometry-todo \\\n    geometry-zsh/geometry \\\n    ael-code/zsh-colored-man-pages \\\n    momo-lab/zsh-abbrev-alias \\\n    jedahan/alacritty-completions \\\n    zpm-zsh/ssh\n}\n```\n\n#### publishing\n\n    git tag 1.2.1\n    git push --tags\n    cargo publish --locked\n\n#### thanks\n\n- [SX91](https://github.com/SX91) for linux fixes\n- [alanpearce](https://github.com/alanpearce) for bug reports and nix package\n- [nshtg](https://github.com/nshtg) for bug reports and windows fix\n- [foray1010](https://github.com/foray1010) for improving install instructions\n- [Avi-D-coder](https://github.com/avi-d-coder) for adding completions support\n- [ralsei](https://github.com/ralsei) for prodding to update crates.io\n- [tekumara](https://github.com/tekumara) for helping figure out --update\n- [myrovh](https://github.com/myrovh) for fixing panics on some linux systems\n- [TimB87](https://github.com/TimB87) for adding openssl 3 support\n- [olets](https://github.com/olets) for adding recursive clone support\n- everyone on [#rust-beginners](irc://irc.mozilla.org/rust-beginners)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedahan%2Fzr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjedahan%2Fzr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedahan%2Fzr/lists"}