diff options
author | Benjamin Lieb <benjamin.m.lieb@gmail.com> | 2023-03-08 03:29:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-08 09:29:21 +0100 |
commit | 3ea0e0d2343a2e79be0c2c6ace030a595d5cec2f (patch) | |
tree | 9048fc32e74752b77a4573bdb0a10a4d8478e01f /plugins/vi-mode/README.md | |
parent | 1c325de464117aa058d5f810b96ed54d65e5d0d5 (diff) | |
download | zsh-3ea0e0d2343a2e79be0c2c6ace030a595d5cec2f.tar.gz zsh-3ea0e0d2343a2e79be0c2c6ace030a595d5cec2f.tar.bz2 zsh-3ea0e0d2343a2e79be0c2c6ace030a595d5cec2f.zip |
docs(vi-mode): document how to add vi-mode info on the prompt (#11548)
Diffstat (limited to 'plugins/vi-mode/README.md')
-rw-r--r-- | plugins/vi-mode/README.md | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/plugins/vi-mode/README.md b/plugins/vi-mode/README.md index 3b819c7cb..0cb516751 100644 --- a/plugins/vi-mode/README.md +++ b/plugins/vi-mode/README.md @@ -51,8 +51,23 @@ MODE_INDICATOR="%F{white}+%f" INSERT_MODE_INDICATOR="%F{yellow}+%f" ``` -You can also use the `vi_mode_prompt_info` function in your prompt, which will display -this mode indicator. +### Adding mode indicators to your prompt + +`Vi-mode` by default will add mode indicators to `RPROMPT` **unless** that is defined by +a preceding plugin. + +If `PROMPT` or `RPROMPT` is not defined to your liking, you can add mode info manually. The `vi_mode_prompt_info` function is available to insert mode indicator information. + +Here are some examples: + +```bash +source $ZSH/oh-my-zsh.sh + +PROMPT="$PROMPT\$(vi_mode_prompt_info)" +RPROMPT="\$(vi_mode_prompt_info)$RPROMPT" +``` + +Note the `\$` here, which importantly prevents interpolation at the time of defining, but allows it to be executed for each prompt update event. ## Cursor Styles |