ZPLUG-IF(5)

πŸ’– zplug-if πŸ’–

okay bestie, welcome to the zplug-if page β€” this is section 5 of the ZPLUG Manual, and it's all about the if tag and when a package gets to install / get used. it's giving "conditional queen" energy ✨


🌸 NAME 🌸

zplug-if β€” the conditions under which to install and/or use the package πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

zplug "username/reponame", if:(( $+commands[git] ))

ngl, quick vocab check before we go any further: the word package here means a string in this exact format: "username/reponame". that's it, that's the whole definition πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea: when you use the if tag, you get to decide whether the package you want to install will be installed as the plugin or as the command. you're literally picking its whole destiny. main character choice fr fr.

Table 1. zplug if tag β€” the vibe check:

  • possible values: plugin, command πŸ’œ
  • default value: plugin ✨

and bestie, if you don't like the default, you can change it with the zstyle command:

$ zstyle ":zplug:tag" if "[[ $OSTYPE == *darwin* ]]"

slay. now the default matches your rules, not the manpage's rules 🌈


πŸ“ EXAMPLES πŸ“

load it if the local directory exists β€” like, only show up if the party's already happening:

$ zplug "~/.zsh" \
    from:local, \
    use:"*.{sh,zsh}", \
    if:"[ -d ~/.zsh ]"

obsessed. if:"[ -d ~/.zsh ]" is doing the whole bouncer-at-the-door thing and we respect it 🫢


πŸ”₯ SEE ALSO πŸ”₯


🧚 FURTHER DOCUMENTATION 🧚

see the references in the official wiki page to get started using zplug. and lowkey? the wiki may perhaps be overwhelming for first-time users β€” not a skill issue, it's just a lot, okay?? take your time, babe πŸ’–


πŸ’œ AUTHORS πŸ’œ

zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). many people have contributed to it β€” a whole squad, iconic πŸ‘‘


πŸŽ€ COPYING πŸŽ€

Copyright (C) 2015-2016 Masaki Ishiyama

MIT License


😭 REPORTING BUGS 😭

report bugs to the zplug issues β€” don't suffer in silence bestie, tell the maintainers πŸ™ˆ


okay that's the whole page!! written up in the ZPLUG Manual, dated 11/21/2016, filed under ZPLUG-IF(5) β€” go forth and use your if tags wisely, mwah πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from