Last active
February 18, 2018 15:35
-
-
Save iwasa-kosui/4b477820338e05e91a1752229ac187a5 to your computer and use it in GitHub Desktop.
function toggling $BULLETTRAIN_PROMPT_ORDER
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What it is
You can toggle showing informations in zsh theme
Bullet Train
.Demo