mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-12 08:10:07 +00:00
add vi-mode segment
This commit is contained in:
parent
bc1b5a4c0b
commit
c08a209e20
2 changed files with 11 additions and 0 deletions
|
@ -233,6 +233,7 @@ currently available are:
|
||||||
|
|
||||||
* **aws** - The current AWS profile, if active (more info below)
|
* **aws** - The current AWS profile, if active (more info below)
|
||||||
* **context** - Your username and host (more info below)
|
* **context** - Your username and host (more info below)
|
||||||
|
* **vi_mode** - Vi editing mode (NORMAL|INSERT).
|
||||||
* **dir** - Your current working directory.
|
* **dir** - Your current working directory.
|
||||||
* **history** - The command number for the current line.
|
* **history** - The command number for the current line.
|
||||||
* **ip** - Shows the current IP address.
|
* **ip** - Shows the current IP address.
|
||||||
|
|
|
@ -575,6 +575,16 @@ prompt_context() {
|
||||||
fi
|
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" "$DEFAULT_COLOR" "default" "$mode"
|
||||||
|
else
|
||||||
|
$1_prompt_segment "$0" "$DEFAULT_COLOR" "blue" "$mode"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Dir: current working directory
|
# Dir: current working directory
|
||||||
prompt_dir() {
|
prompt_dir() {
|
||||||
local current_path='%~'
|
local current_path='%~'
|
||||||
|
|
Loading…
Reference in a new issue