Add the vagrant-prompt
plugin to the PROMPT
#2831
Closed
alexventuraio
started this conversation in
General
Replies: 2 comments 4 replies
-
You would need to implement a custom prompt segment. Run |
Beta Was this translation helpful? Give feedback.
2 replies
-
I think that the output from the vagrant-prompt plugin is meant for other type of prompt that do not place nicely with Powerleve10K theme. So, adding that plugin to your Based on the function prompt_vagrant_status() {
if [[ ! -d .vagrant || ! -f Vagrantfile ]]; then
return
fi
local vm_states vm_state
vm_states=(${(f)"$(vagrant status 2> /dev/null | sed -nE 's/^[^ ]* *([[:alnum:] ]*) \([[:alnum:]_]+\)$/\1/p')"})
for vm_state in $vm_states; do
case "$vm_state" in
running) p10k segment -b 239 -f green -i '●' ;;
"not running"|poweroff) p10k segment -b 239 -f red -i '●' ;;
paused|saved|suspended) p10k segment -b 239 -f cyan -i '●' ;;
"not created") p10k segment -b 239 -f white -i '○' ;;
esac
done
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently installed Oh My ZSH! and then I configured the Powerlevel10k theme following the official instruction.
Then, based on the list of supported official plugins here I wanted to use the vagrant-prompt one and my
.zshrc
file now has.But following the described instructions from the plugin, I'm not sure where exactly to add the
vagrant_prompt_info
function.I have tried adding it to here:
Also in this other one like this:
But I still get nothing.
If I exec the
vagrant_prompt_info
function it shows this:Does anyone have an idea of what I maybe doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions