---
name: "zplug-if"
section: "5"
platform: "linux"
package: "zplug"
version: "2.4.2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/zplug-if"
---

# zplug-if(5)

The conditions under which to install and/or use the package

## NAME

zplug-if - The conditions under which to install and/or use the package

## SYNOPSIS

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

```
The word ´package´ refers to the string in the format: "username/reponame".
```

## DESCRIPTION

By using if tag, you can choose whether the package you want to install will be installed as the plugin or as the command.

**Table 1. zplug if tag**

| | |
| --- | --- |
| **Possive Values** | **Default value** |
| plugin, command | plugin |

Besides, by using zstyle command, you can change default value:

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

## EXAMPLES

Load if the local directory exists:

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

## SEE ALSO

**[zplug(1)](/zplug/1.md)**

## FURTHER DOCUMENTATION

See the references in official wiki page to get started using zplug. The wiki may perhaps be overwhelming for first-time users.

## AUTHORS

zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it.

## COPYING

Copyright (C) 2015-2016 Masaki Ishiyama

MIT License

## REPORTING BUGS

Report bugs to the zplug issues
