Skip to content
/ zr Public

zsh plugin manager written in rust

License

Notifications You must be signed in to change notification settings

jedahan/zr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Jonathan Dahan
Jul 7, 2017
2aaa41c · Jul 7, 2017

History

56 Commits
Jul 7, 2017
Jul 7, 2017
May 7, 2017
May 25, 2017
Jul 7, 2017
Jul 7, 2017
Jul 7, 2017
Jul 7, 2017

Repository files navigation

z 🐀

zr 0.6.0
Jonathan Dahan <[email protected]>
z:rat: - zsh plugin manager

USAGE:
    zr [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    help      Prints this message or the help of the given subcommand(s)
    list      list plugins
    load      generate init file from plugin list
    update    update plugins

usage

Add this to your ~/.zshrc:

# Generate new ~/.zr/init.zsh whenever ~/.zshrc is modified
[[ ~/.zshrc -nt ~/.zr/init.zsh ]] && {
  zr load \
    frmendes/geometry \
    jedahan/geometry-hydrate \
    junegunn/fzf/shell/key-bindings.zsh  # just load key-bindings.zsh
}

source ~/.zr/init.zsh

If you'd like a different directory for ~/.zr, just set ZR_HOME

speed

The following init.zsh takes 180ms total, with 20ms spent in zr load for my 2012 13" retina macbook pro. See the wiki for more details.

# ~20ms
zr load \
  zsh-users/prezto/modules/git/alias.zsh \
  zsh-users/prezto/modules/osx/init.zsh \
  zsh-users/prezto/modules/history/init.zsh \
  junegunn/fzf/shell/key-bindings.zsh \
  zsh-users/zsh-autosuggestions \
  zdharma/fast-syntax-highlighting \
  zsh-users/zsh-history-substring-search \
  molovo/tipz \
  changyuheng/zsh-interactive-cd \
  frmendes/geometry \
  jedahan/geometry-hydrate
source ~/.zr/init.zsh # ~160ms

benchmarks

cargo +nightly bench

You can also bench a minimal zsh loading, with

time zsh -i -c "source \"$PWD\"/benches/zshrc-zr; zprof"

developing

cargo +nightly build --features="clippy"

thanks

  • SX91 for linux fixes