diff options
| author | Marc Cornellà <marc@mcornella.com> | 2024-08-09 09:44:46 +0200 |
|---|---|---|
| committer | Marc Cornellà <marc@mcornella.com> | 2024-08-09 09:44:46 +0200 |
| commit | efafef8495f030501e0df59ccb76a598bbce3ae1 (patch) | |
| tree | 561eaba6adf7cd198d0b8d5b3c07dcd724572b72 /plugins/vagrant-prompt | |
| parent | fccaaf2fc60149baab966acaeae35f55325e6f98 (diff) | |
| download | zsh-efafef8495f030501e0df59ccb76a598bbce3ae1.tar.gz zsh-efafef8495f030501e0df59ccb76a598bbce3ae1.tar.bz2 zsh-efafef8495f030501e0df59ccb76a598bbce3ae1.zip | |
docs: improve several plugin READMEs and add one for `ssh` plugin
Diffstat (limited to 'plugins/vagrant-prompt')
| -rw-r--r-- | plugins/vagrant-prompt/README.md | 31 | ||||
| -rw-r--r-- | plugins/vagrant-prompt/vagrant-prompt.plugin.zsh | 17 |
2 files changed, 29 insertions, 19 deletions
diff --git a/plugins/vagrant-prompt/README.md b/plugins/vagrant-prompt/README.md index dd0ca363b..0720f4bde 100644 --- a/plugins/vagrant-prompt/README.md +++ b/plugins/vagrant-prompt/README.md @@ -1,6 +1,33 @@ +# vagrant-prompt + This plugin prompts the status of the Vagrant VMs. It supports single-host and multi-host configurations as well. -Look inside the source for documentation about custom variables. +To use it, add `vagrant-prompt` to the plugins array in your zshrc file: + +```zsh +plugins=(... vagrant-prompt) +``` + +**Alberto Re <alberto.re@gmail.com>** + +## Usage + +To display Vagrant info on your prompt add the `vagrant_prompt_info` to the +`$PROMPT` or `$RPROMPT` variable in your theme. Example: + +```zsh +PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(vagrant_prompt_info)$(svn_prompt_info)$(git_prompt_info)%(!.#.$) ' +``` + +`vagrant_prompt_info` makes use of some custom variables. This is an example +definition: -Alberto Re <alberto.re@gmail.com> +```zsh +ZSH_THEME_VAGRANT_PROMPT_PREFIX="%{$fg_bold[blue]%}[" +ZSH_THEME_VAGRANT_PROMPT_SUFFIX="%{$fg_bold[blue]%}]%{$reset_color%} " +ZSH_THEME_VAGRANT_PROMPT_RUNNING="%{$fg_no_bold[green]%}●" +ZSH_THEME_VAGRANT_PROMPT_POWEROFF="%{$fg_no_bold[red]%}●" +ZSH_THEME_VAGRANT_PROMPT_SUSPENDED="%{$fg_no_bold[yellow]%}●" +ZSH_THEME_VAGRANT_PROMPT_NOT_CREATED="%{$fg_no_bold[white]%}○" +``` diff --git a/plugins/vagrant-prompt/vagrant-prompt.plugin.zsh b/plugins/vagrant-prompt/vagrant-prompt.plugin.zsh index d7c76c3c9..29f4038c5 100644 --- a/plugins/vagrant-prompt/vagrant-prompt.plugin.zsh +++ b/plugins/vagrant-prompt/vagrant-prompt.plugin.zsh @@ -1,20 +1,3 @@ -# vim:ft=zsh ts=2 sw=2 sts=2 -# -# To display Vagrant infos on your prompt add the vagrant_prompt_info to the -# $PROMPT variable in your theme. Example: -# -# PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(vagrant_prompt_info)$(svn_prompt_info)$(git_prompt_info)%(!.#.$) ' -# -# `vagrant_prompt_info` makes use of some custom variables. This is an example -# definition: -# -# ZSH_THEME_VAGRANT_PROMPT_PREFIX="%{$fg_bold[blue]%}[" -# ZSH_THEME_VAGRANT_PROMPT_SUFFIX="%{$fg_bold[blue]%}]%{$reset_color%} " -# ZSH_THEME_VAGRANT_PROMPT_RUNNING="%{$fg_no_bold[green]%}●" -# ZSH_THEME_VAGRANT_PROMPT_POWEROFF="%{$fg_no_bold[red]%}●" -# ZSH_THEME_VAGRANT_PROMPT_SUSPENDED="%{$fg_no_bold[yellow]%}●" -# ZSH_THEME_VAGRANT_PROMPT_NOT_CREATED="%{$fg_no_bold[white]%}○" - function vagrant_prompt_info() { local vm_states vm_state if [[ -d .vagrant && -f Vagrantfile ]]; then |
