Skip to content

Instantly share code, notes, and snippets.

@iwasa-kosui
Last active February 18, 2018 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iwasa-kosui/4b477820338e05e91a1752229ac187a5 to your computer and use it in GitHub Desktop.
Save iwasa-kosui/4b477820338e05e91a1752229ac187a5 to your computer and use it in GitHub Desktop.
function toggling $BULLETTRAIN_PROMPT_ORDER
# Toggle $BULLETTRAIN_PROMPT_ORDER
bpo() {
for i in $@; do
if type "prompt_$i" > /dev/null; then
if (( ${BULLETTRAIN_PROMPT_ORDER[(I)$i]} )); then
BULLETTRAIN_PROMPT_ORDER=(${BULLETTRAIN_PROMPT_ORDER:#$i})
else
BULLETTRAIN_PROMPT_ORDER+=($i)
fi
else
echo "prompt_$i does not exist"
fi
done
}
# Completion of tg-bpo
_bpo() {
local prompts=`typeset -f | grep "^prompt_*" | sed -e 's/prompt_//' | sed -e "s/ .*//" | tr '\n' ' '`
_values 'prompts' ${(z)prompts}
}
# Set _tg-bpo as completion of tg-bpo
compdef _bpo bpo
@iwasa-kosui
Copy link
Author

iwasa-kosui commented Feb 18, 2018

What it is

You can toggle showing informations in zsh theme Bullet Train.

Demo

default

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