• Stars
    star
    163
  • Rank 231,141 (Top 5 %)
  • Language
    Rust
  • License
    Mozilla Public Li...
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

zsh plugin manager written in rust

zr(at)

Quick, simple zsh plugin manager

zrat

zr 1.1.0
by Jonathan Dahan <[email protected]>

zr [[http://example.com]plugin/name[.git/a/file.zsh]]    fetch plugins and output sourceable zsh
zr --update                                              updates plugins from already sourced zsh
zr help                                                  show help

Examples

zr author/name                                  *.zsh from github.com/author/name
zr author/name/file.zsh                      file.zsh from github.com/author/name
zr https://gitlab.com/a/plugin                  *.zsh from gitlab.com/a/plugin
zr https://gitlab.com/a/plugin.git/file.zsh  file.zsh from gitlab.com/a/plugin

install

zr is published to crates.io, and can be installed with cargo install zr

usage

Add this to your ~/.zshrc:

# simplest usage
. <(zr frmendes/geometry junegunn/fzf.git/shell/key-bindings.zsh)

A bit more complex example, that only generates when .zshrc has been updated:

# Generate new ~/.config/zr.zsh if it does not exist or if ~/.zshrc has been changed
if [[ ! -f ~/.config/zr.zsh ]] || [[ ~/.zshrc -nt ~/.config/zr.zsh ]]; then
  zr \
    frmendes/geometry \
    jedahan/geometry-hydrate \
    junegunn/fzf.git/shell/key-bindings.zsh \
    > ~/.config/zr.zsh
fi

source ~/.config/zr.zsh

identifiers

zr supports four identifier formats. The last format requires .git as a delimeter.

format resolves to
author/name *.zsh from https://github.com/author/name
author/name/file.zsh file.zsh from https://github.com/author/name
https://gitlab.com/a/plugin *.zsh from https://gitlab.com/a/plugin
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.

speed

The following two benchmarks show on my dell xps13 9380

  • it takes 5ms to generate a sourceable script from a dozen or so repos
  • it takes an additional 15ms for zsh to load said script
# install hyperfine for benchmarking
$ which hyperfine || cargo install hyperfine

# run 
$ hyperfine --warmup 3 'zsh -d -f -l -c "source benchmark.zsh && zrinit && exit"' 'zsh -d -f -l -c "source benchmark.zsh && . <(zrinit) && exit"'

Benchmark #1: zsh -d -f -l -c "source benchmark.zsh && zrinit && exit"
  Time (mean ± σ):       5.3 ms ±   2.3 ms    [User: 2.8 ms, System: 2.4 ms]
  Range (min … max):     2.9 ms …   9.9 ms    285 runs

Benchmark #2: zsh -d -f -l -c "source benchmark.zsh && . <(zrinit) && exit"
  Time (mean ± σ):      21.8 ms ±   1.0 ms    [User: 17.5 ms, System: 5.1 ms]
  Range (min … max):    19.7 ms …  26.4 ms    127 runs
# benchmark.zsh
function zrinit {
  XDG_CACHE_HOME=/tmp/zrbenchmark zr sorin-ionescu/prezto.git/modules/git/alias.zsh \
    sorin-ionescu/prezto.git/modules/history/init.zsh \
    junegunn/fzf.git/shell/key-bindings.zsh \
    zsh-users/zsh-autosuggestions \
    zdharma/fast-syntax-highlighting \
    molovo/tipz \
    geometry-zsh/geometry \
    jedahan/geometry-hydrate \
    jedahan/geometry-todo \
    geometry-zsh/geometry \
    ael-code/zsh-colored-man-pages \
    momo-lab/zsh-abbrev-alias \
    jedahan/alacritty-completions \
    zpm-zsh/ssh
}

thanks

  • SX91 for linux fixes
  • alanpearce for bug reports and nix package
  • nshtg for bug reports and windows fix
  • foray1010 for improving install instructions
  • Avi-D-coder for adding completions support
  • ralsei for prodding to update crates.io
  • tekumara for helping figure out --update
  • myrovh for fixing panics on some linux systems
  • TimB87 for adding openssl 3 support
  • everyone on #rust-beginners

More Repositories

1

haiku-wifi

turn your wireless router's extra radios into a public billboard!
Python
73
star
2

collections-api

API scraping from the metmuseum website
JavaScript
36
star
3

podman-desktop

launch and setup vms for podman
Shell
28
star
4

ripz

💡 ripgrep-powered zsh plugin alias reminder
Shell
24
star
5

hypermac

run hypercard 2.1 in system 6.08 on linux and os x
20
star
6

piwall

Shell
14
star
7

dotfiles

🌺 zsh, git, neovim
Shell
13
star
8

rustboy

A game boy emulator in rust
Rust
10
star
9

palmos

palmos 2.0 development environment, using docker
C
8
star
10

baculus

peer-to-peer internet in a backpack, built on scuttlebutt, raspberry pi
HTML
8
star
11

kiss-repo

custom packages for kiss
Shell
8
star
12

raspberry-pico-8

really alpha
Shell
8
star
13

atom-speech-to-code

CoffeeScript
7
star
14

kiss-find

search across all kiss repositories
JavaScript
7
star
15

ssb-dissector

Lua
5
star
16

saltpeanuts

how to schedule time
JavaScript
5
star
17

twelve-plus-eight

recreating http://www.heikewerner.com/images/oxenaar_pk4.jpg
Clojure
5
star
18

ofInspiration

pick random addons
C++
5
star
19

autones

plug into your NES, and watch the best speedrunners play the games for you
Lua
4
star
20

deadc.net

CoffeeScript
4
star
21

kiss-containers

podman + podman-compose: simple, daemonless, rootless containerization
Shell
4
star
22

kiss-universe

3
star
23

LinkedSensorDataVis

CCC2011 DATAAAA stuffs
CoffeeScript
3
star
24

sfpcbot

a bot for #sfpc on freenode, http://sfpc.io
CoffeeScript
3
star
25

mesh-visualisation

JavaScript
2
star
26

abug.in

http://abug.in/everything
JavaScript
2
star
27

ssbvan

Rust
2
star
28

pucd2035d

CSS
2
star
29

bike-in-movie

Use a bike to control the speed of a film :)
Java
2
star
30

textual-twitchplayspokemon

plugin to hide some text from irc
2
star
31

ink

boot template for interactive clojurescript/quil sketching
Clojure
2
star
32

scripts

Ruby
2
star
33

twitter-bot

dangerous twitter bots for @tegabrain
JavaScript
2
star
34

metapng

metapng writes and reads png metadata
Clojure
2
star
35

glitch

Shell
2
star
36

interface-experience

A collection of interactive applications on commodore 64, mac plus, palm pilot, ipad and kinect
2
star
37

ofMath

exploration of floating point numbers, thanks to openframeworks pull request 3824
C++
1
star
38

willfixeverything

Ruby
1
star
39

accumulator

Created at http://arthackday.net
Arduino
1
star
40

rustychain

blockchain client in rust
Rust
1
star
41

exheres

exherbo exheres
1
star
42

laser

Shell
1
star
43

wattCrank

C++
1
star
44

collectioncolours

streamgraph of the colours of art
JavaScript
1
star
45

conway

JavaScript
1
star
46

timesearch

JavaScript
1
star
47

kiss-testing

testing in containers for kisslinux
Shell
1
star
48

twitter-trafficlight

twitter-trafficlight
CoffeeScript
1
star
49

creature

Shell
1
star
50

lantern-serve

Database & Web Server for Decentralized Applications
JavaScript
1
star
51

twitter-sample

sockets and twitter and restify oh my!
CoffeeScript
1
star
52

ruby

Ruby topic repository for Exherbo
1
star
53

geometry-hydrate

geometry prompt plugin reminding you to hydrate
Shell
1
star
54

openvizsla2c

CoffeeScript
1
star
55

samba-haiku

JavaScript
1
star
56

ofHttpPost

Makefile
1
star
57

scat

JavaScript
1
star
58

interactive_art

talk on interactive art for I-Con 31
1
star
59

full-stack-test-master

1
star
60

pagesounds

CoffeeScript
1
star
61

dotfiles_linux

zshrc, xdefaults, xinitrc, profile, libfm, pcmanfm, tilda
1
star
62

c64

Visual Basic
1
star
63

advent-of-code-2021

in deno
TypeScript
1
star
64

nerdy-nights-tutorial

Assembly
1
star
65

class-activities

Public collection of activities and how well they have worked out
CoffeeScript
1
star
66

abolish-ice

microsoft and github, stop collaborating with ice
1
star
67

kiss-repo-repos

repository of kiss repositories
Shell
1
star
68

kisscommunity.org

CSS
1
star
69

github-actions-kiss-lint

1
star
70

laughing_man

Java
1
star
71

contact_card

this is how I do contact cards
CoffeeScript
1
star