aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2018-03-07 05:02:01 +0300
committerGitHub <noreply@github.com>2018-03-07 05:02:01 +0300
commitdb3ae5f053f73c588b6c46e48af1fe0dc777ee7f (patch)
tree3bb95175448c096bf360fd1115619d79d28f5f3b /powerlevel9k.zsh-theme
parentb8a68dd4a88cc0454ed1e385765d368e7fb50429 (diff)
parentf17a715610246cb4abe965b2e479ee168c800ad6 (diff)
Merge pull request #740 from ionsquare/master
Fix vi-mode and support hiding segment when in insert mode
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme10
1 files changed, 10 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 8dee7f27..d4df766a 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1437,6 +1437,7 @@ prompt_vi_mode() {
"$1_prompt_segment" "$0_NORMAL" "$2" "$DEFAULT_COLOR" "default" "$POWERLEVEL9K_VI_COMMAND_MODE_STRING"
;;
main|viins|*)
+ if [[ -z $POWERLEVEL9K_VI_INSERT_MODE_STRING ]]; then return; fi
"$1_prompt_segment" "$0_INSERT" "$2" "$DEFAULT_COLOR" "blue" "$POWERLEVEL9K_VI_INSERT_MODE_STRING"
;;
esac
@@ -1625,8 +1626,15 @@ NEWLINE='
[[ $POWERLEVEL9K_PROMPT_ADD_NEWLINE == true ]] && PROMPT="$NEWLINE$PROMPT"
}
+
+zle-keymap-select () {
+ zle reset-prompt
+ zle -R
+}
+
set_default POWERLEVEL9K_IGNORE_TERM_COLORS false
set_default POWERLEVEL9K_IGNORE_TERM_LANG false
+
prompt_powerlevel9k_setup() {
# The value below was set to better support 32-bit CPUs.
# It's the maximum _signed_ integer value on 32-bit CPUs.
@@ -1690,6 +1698,8 @@ prompt_powerlevel9k_setup() {
# prepare prompts
add-zsh-hook precmd powerlevel9k_prepare_prompts
add-zsh-hook preexec powerlevel9k_preexec
+
+ zle -N zle-keymap-select
}
prompt_powerlevel9k_teardown() {