3ea0e0d2343a2e79be0c2c6ace030a595d5cec2f

Author
Benjamin Lieb <benjamin.m.lieb@gmail.com>
Committer
GitHub <noreply@github.com>
Date

Message

docs(vi-mode): document how to add vi-mode info on the prompt (#11548)

Diff

 1diff --git a/plugins/vi-mode/README.md b/plugins/vi-mode/README.md
 2index 3b819c7cba8d3a3aabcec8a2cb1aab2edfe1e60b..0cb516751fe4c621aeca650d0a9342375509d869 100644
 3--- a/plugins/vi-mode/README.md
 4+++ b/plugins/vi-mode/README.md
 5@@ -51,8 +51,23 @@ MODE_INDICATOR="%F{white}+%f"
 6 INSERT_MODE_INDICATOR="%F{yellow}+%f"
 7 ```
 8 
 9-You can also use the `vi_mode_prompt_info` function in your prompt, which will display
10-this mode indicator.
11+### Adding mode indicators to your prompt
12+
13+`Vi-mode` by default will add mode indicators to `RPROMPT` **unless** that is defined by 
14+a preceding plugin.
15+
16+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.
17+
18+Here are some examples:
19+
20+```bash
21+source $ZSH/oh-my-zsh.sh
22+
23+PROMPT="$PROMPT\$(vi_mode_prompt_info)"
24+RPROMPT="\$(vi_mode_prompt_info)$RPROMPT"
25+```
26+
27+Note the `\$` here, which importantly prevents interpolation at the time of defining, but allows it to be executed for each prompt update event.
28 
29 ## Cursor Styles
30