aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2015-10-18 06:19:53 +0300
committerBen Hilburn <bhilburn@gmail.com>2015-10-18 06:19:53 +0300
commit34add8aedf3bcd7ca77ccec28305f9d542502dca (patch)
tree34f48851988c9ee576ea3d25d7117c69de3327d5
parentc6f8184585f9100be644c8613d81cbd8c06daf17 (diff)
parent86b460f06bfb01f782026af806c2dc68f8925621 (diff)
Merge pull request #117 from dritter/vi_customizations
Make the vi_mode segement more customizable.
-rw-r--r--README.md6
-rwxr-xr-xpowerlevel9k.zsh-theme6
2 files changed, 10 insertions, 2 deletions
diff --git a/README.md b/README.md
index 958889f2..e5c506ae 100644
--- a/README.md
+++ b/README.md
@@ -233,6 +233,12 @@ VI-Mode, you need to configure it separately in your `~/.zshrc`:
# make it more responsive
export KEYTIMEOUT=1
+If you want to display another string than "NORMAL" or "INSERT" in command or
+insert-mode, you can do that by setting environment variables like:
+
+ POWERLEVEL9K_VI_INSERT_MODE_STRING="INS"
+ POWERLEVEL9K_VI_COMMAND_MODE_STRING="CMD"
+
#### Unit Test Ratios
The `symfony2_tests` and `rspec_stats` segments both show a ratio of "real"
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 28e65a25..ad7ce272 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -871,13 +871,15 @@ prompt_todo() {
}
# Vi Mode: show editing mode (NORMAL|INSERT)
+set_default POWERLEVEL9K_VI_INSERT_MODE_STRING "INSERT"
+set_default POWERLEVEL9K_VI_COMMAND_MODE_STRING "NORMAL"
prompt_vi_mode() {
case ${KEYMAP} in
main|viins)
- "$1_prompt_segment" "$0_INSERT" "$DEFAULT_COLOR" "blue" "INSERT"
+ "$1_prompt_segment" "$0_INSERT" "$DEFAULT_COLOR" "blue" "$POWERLEVEL9K_VI_INSERT_MODE_STRING"
;;
vicmd)
- "$1_prompt_segment" "$0_NORMAL" "$DEFAULT_COLOR" "default" "NORMAL"
+ "$1_prompt_segment" "$0_NORMAL" "$DEFAULT_COLOR" "default" "$POWERLEVEL9K_VI_COMMAND_MODE_STRING"
;;
esac
}