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

Add vi-mode segment
This commit is contained in:
Ben Hilburn 2015-09-19 16:30:37 -07:00
commit 6deb3fe094
2 changed files with 11 additions and 0 deletions

View file

@ -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='%~'