94ce46d48b901ed9e581ccad22d9192c25507acd
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- Marc Cornellà <marc.cornella@live.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/vi-mode/README.md b/plugins/vi-mode/README.md
2index 8519a559291cd9de41a0f0fd049f36de075f6bec..fdf3ede73a9a0c4bf02f4ca8a95a2629621e479b 100644
3--- a/plugins/vi-mode/README.md
4+++ b/plugins/vi-mode/README.md
5@@ -1,34 +1,59 @@
6-vi-mode
7-=======
8+# vi-mode plugin
9+
10 This plugin increase `vi-like` zsh functionality.
11
12-Use `ESC` or `CTRL-[` to enter `Normal mode`.
13+To use it, add `vi-mode` to the plugins array in your zshrc file:
14
15+```zsh
16+plugins=(... vi-mode)
17+```
18
19-History
20--------
21+## Settings
22
23-- `ctrl-p` : Previous command in history
24-- `ctrl-n` : Next command in history
25-- `/` : Search backward in history
26-- `n` : Repeat the last `/`
27+- `VI_MODE_RESET_PROMPT_ON_MODE_CHANGE`: controls whether the prompt is redrawn when
28+ switching to a different input mode. If this is unset, the mode indicator will not
29+ be updated when changing to a different mode.
30+ Set it to `true` to enable it. For example:
31
32+ ```zsh
33+ VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true
34+ ```
35
36-Mode indicators
37----------------
38+ The default value is unset, unless `vi_mode_prompt_info` is used, in which case it'll
39+ automatically be set to `true`.
40
41-*Normal mode* is indicated with red `<<<` mark at the right prompt, when it
42-wasn't defined by theme.
43+- `MODE_INDICATOR`: controls the string displayed when the shell is in normal mode.
44+ See [Mode indicator](#mode-indicator) for details.
45
46+## Mode indicator
47
48-Vim edition
49------------
50+*Normal mode* is indicated with a red `<<<` mark at the right prompt, when it
51+hasn't been defined by theme.
52
53-- `v` : Edit current command line in Vim
54+You can change this indicator by setting the `MODE_INDICATOR` variable. This setting
55+supports Prompt Expansion sequences. For example:
56+
57+```zsh
58+MODE_INDICATOR="%F{yellow}+%f"
59+```
60+
61+You can also use the `vi_mode_prompt_info` function in your prompt, which will display
62+this mode indicator.
63+
64+## Key bindings
65+
66+Use `ESC` or `CTRL-[` to enter `Normal mode`.
67
68+NOTE: some of these key bindings are set by zsh by default when using a vi-mode keymap.
69
70-Movement
71---------
72+### History
73+
74+- `ctrl-p` : Previous command in history
75+- `ctrl-n` : Next command in history
76+- `/` : Search backward in history
77+- `n` : Repeat the last `/`
78+
79+### Movement
80
81 - `$` : To the end of the line
82 - `^` : To the first non-blank character of the line
83@@ -46,9 +71,7 @@ Movement
84 - `;` : Repeat latest f, t, F or T [count] times
85 - `,` : Repeat latest f, t, F or T in opposite direction
86
87-
88-Insertion
89----------
90+### Insertion
91
92 - `i` : Insert text before the cursor
93 - `I` : Insert text before the first character in the line
94@@ -57,9 +80,7 @@ Insertion
95 - `o` : Insert new command line below the current one
96 - `O` : Insert new command line above the current one
97
98-
99-Delete and Insert
100------------------
101+### Delete and Insert
102
103 - `ctrl-h` : While in *Insert mode*: delete character before the cursor
104 - `ctrl-w` : While in *Insert mode*: delete word before the cursor