Skip to content

Instantly share code, notes, and snippets.

@prat0318
Created January 14, 2015 12:23
Show Gist options
  • Select an option

  • Save prat0318/e962e3dd8e63751fe916 to your computer and use it in GitHub Desktop.

Select an option

Save prat0318/e962e3dd8e63751fe916 to your computer and use it in GitHub Desktop.
`options` command to show all the aliases and functions offered by plugins you have installed via oh-my-zsh
function options() {
PLUGIN_PATH="$HOME/.oh-my-zsh/plugins/"
for plugin in $plugins; do
echo "\n\nPlugin: $plugin"; grep -r "^function \w*" $PLUGIN_PATH$plugin | awk '{print $2}' | sed 's/()//'| tr '\n' ', '; grep -r "^alias" $PLUGIN_PATH$plugin | awk '{print $2}' | sed 's/=.*//' | tr '\n' ', '
done
}
@clusin
Copy link

clusin commented Nov 30, 2019

Hello from random google search. Should use $ZSH instead of home for custom path to zsh installs.

@prat0318
Copy link
Author

prat0318 commented Dec 1, 2019

Thanks for the note. But if one uses dotfiles, $ZSH will point to dot-files directory, instead of oh-my-zsh one:

prateeka@prateeka-C02XC9SRJG5J ➜  Uber echo $ZSH                                            [22:00:03]
/Users/prateeka/.dotfiles

@ztjuh
Copy link

ztjuh commented Dec 16, 2025

I have a bug with your script. Also you might just check if $ZSH is .dotfiles or the $ZSH directory

Plugin: zsh-autosuggestions
grep: /home/alex/.oh-my-zsh/plugins/zsh-autosuggestions: No such file or directory
grep: /home/alex/.oh-my-zsh/plugins/zsh-autosuggestions: No such file or directory


Plugin: zsh-syntax-highlighting
grep: /home/alex/.oh-my-zsh/plugins/zsh-syntax-highlighting: No such file or directory
grep: /home/alex/.oh-my-zsh/plugins/zsh-syntax-highlighting: No such file or directory


Plugin: fast-syntax-highlighting
grep: /home/alex/.oh-my-zsh/plugins/fast-syntax-highlighting: No such file or directory
grep: /home/alex/.oh-my-zsh/plugins/fast-syntax-highlighting: No such file or directory


Plugin: zsh-bat
grep: /home/alex/.oh-my-zsh/plugins/zsh-bat: No such file or directory
grep: /home/alex/.oh-my-zsh/plugins/zsh-bat: No such file or directory

It's in the .oh-my-zsh/custom/plugins/ directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment