21

I want to install 2 Oh My Zsh plugins, but I don't know their names. My brother had also downloaded them some years ago, but he doesn't know their names either.

How can I know what Oh My Zsh plugins are installed in my brother's zsh?

2 Answers2

30

I suppose that you installed Oh My Zsh by running the following command:

sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

In this case, Oh My Zsh plugins are installed in the ~/.oh-my-zsh/plugins directory, so running the following command will return a list of your installed plugins:

ls ~/.oh-my-zsh/plugins

To enable a plugin, just add its name (as shown from the above command) in plugins=(...) in your ~/.zshrc file. From the Oh My Zsh wiki:

Enable a plugin by adding its name to the plugins array in your .zshrc file (found in the $HOME directory). For example, this enables the rails, git and ruby plugins, in that order:

plugins=(rails git ruby)

You can list the enabled plugins with:

echo $plugins
5

There's another way of listing and enabling/disabling installed plugins using the omz command.

  • To list installed plugins you can run:

    omz plugin list
    
  • To enable a plugin you can run:

    omz plugin enable <plugin>
    

    where <plugin> is the name of the plugin you wish to enable. For example, to enable the common-aliases plugin, you would run:

    omz plugin enable common-aliases
    
  • To disable a plugin you can run:

    omz plugin disable <plugin>
    

    For example, to disable the common-aliases plugin, you would run:

    omz plugin disable common-aliases
    
  • The omz command is pretty handy and can also be used to obtain information about a plugin:

    omz plugin info <plugin>
    

    For example, running omz plugin info ufw returns information about the ufw plugin:

    # UFW plugin
    

    This plugin adds completion for managing everybody's favorite Uncomplicated Firewall (UFW), a simple interface for managing iptables. Learn more about UFW.

    To use it, add ufw to the plugins array of your zshrc file:

    plugins=(... ufw)
    

    Some of the commands include:

    • allow &lt;port&gt;/&lt;optional: protocol&gt; add an allow rule
    • default set default policy
    • delete &lt;port&gt;/&lt;optional: protocol&gt; delete RULE
    • deny &lt;port&gt;/&lt;optional: protocol&gt; add deny rule
    • disable disables the firewall
    • enable enables the firewall`

For more information about omz's usage you can run:

omz --help