website/docs/segments/system/vimode.mdx
Display the current ZSH Vi mode (insert / normal / visual …) in
the prompt. Useful when using bindkey -v so you can tell at a glance which
mode you are in.
:::caution
This segment is currently only supported in ZSH. Adding it to your
configuration will automatically register a zle-keymap-select hook that
re-renders the prompt every time the keymap changes.
:::
import Config from "@site/src/components/Config.js";
<Config data={{ type: "vimode", style: "plain", foreground: "#ffffff", background: "#0077c2", template: " {{ if eq .Mode "normal" }} NORMAL{{ else if eq .Mode "visual" }} VISUAL{{ else }} INSERT{{ end }} ", }} />
:::note default template
{{ .Mode }}
:::
| Name | Type | Description |
|---|---|---|
.Mode | string | the normalized mode: insert, normal, visual, viopp, replace, or the raw keymap when unmapped |
.Keymap | string | the raw $KEYMAP value reported by ZSH (e.g. main, viins, vicmd, visual, viopp) |