Back to Oh My Posh

Vi mode

website/docs/segments/system/vimode.mdx

29.18.01.5 KB
Original Source

What

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. :::

Sample Configuration

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 }} ", }} />

Template (info)

:::note default template

template
 {{ .Mode }}

:::

Properties

NameTypeDescription
.Modestringthe normalized mode: insert, normal, visual, viopp, replace, or the raw keymap when unmapped
.Keymapstringthe raw $KEYMAP value reported by ZSH (e.g. main, viins, vicmd, visual, viopp)