Merge pull request #98 from christian-schulze/vi-mode-segment

Add vi-mode segment
pull/22/head
Ben Hilburn 9 years ago
commit 6deb3fe094

@ -233,6 +233,7 @@ currently available are:
* **aws** - The current AWS profile, if active (more info below)
* **context** - Your username and host (more info below)
* **vi_mode** - Vi editing mode (NORMAL|INSERT).
* **dir** - Your current working directory.
* **history** - The command number for the current line.
* **ip** - Shows the current IP address.

@ -576,6 +576,16 @@ prompt_context() {
fi
}
# Vi Mode: show editing mode (NORMAL|INSERT)
prompt_vi_mode() {
local mode="${${KEYMAP/vicmd/NORMAL}/(main|viins)/INSERT}"
if [[ "$mode" == "NORMAL" ]]; then
$1_prompt_segment "$0_NORMAL" "$DEFAULT_COLOR" "default" "$mode"
else
$1_prompt_segment "$0_INSERT" "$DEFAULT_COLOR" "blue" "$mode"
fi
}
# Dir: current working directory
prompt_dir() {
local current_path='%~'

Loading…
Cancel
Save