Skip to content

Instantly share code, notes, and snippets.

@nelson-ph
Forked from prat0318/options.zsh
Created October 25, 2017 13:31
Show Gist options
  • Save nelson-ph/97853043aefa78c7e275dfc8733c67c2 to your computer and use it in GitHub Desktop.
Save nelson-ph/97853043aefa78c7e275dfc8733c67c2 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
RED=`tput setaf 1`
NOCOLOR=`tput sgr0`
function options() {
PLUGIN_PATH="$HOME/.oh-my-zsh/plugins/"
for plugin in $plugins; do
echo "\n\n${RED}Plugin: $plugin${NOCOLOR}";
if [ -d $PLUGIN_PATH$plugin ]; then
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' ', '
else
echo "No commands available";
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment