From 772ed865015a30f38bbd20795acc75484c4b63f2 Mon Sep 17 00:00:00 2001 From: Colin Jamison Date: Sat, 21 Jan 2017 18:15:25 +0100 Subject: [PATCH] Conditionally bind zle widget --- modules/prompt/themes/eriner.zsh-theme | 2 +- modules/prompt/themes/gitster.zsh-theme | 2 +- modules/prompt/themes/magicmace.zsh-theme | 2 ++ modules/prompt/themes/steeef.zsh-theme | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/prompt/themes/eriner.zsh-theme b/modules/prompt/themes/eriner.zsh-theme index 3215eda..b67e286 100644 --- a/modules/prompt/themes/eriner.zsh-theme +++ b/modules/prompt/themes/eriner.zsh-theme @@ -157,7 +157,7 @@ prompt_eriner_setup() { add-zsh-hook prompt_eriner_precmd - zle -N zle-keymap-select + [[ "$ZIM_PROMPT_INSERTMODE" != '' ]] && zle -N zle-keymap-select zstyle ':vcs_info:*' enable git zstyle ':vcs_info:*' check-for-changes false diff --git a/modules/prompt/themes/gitster.zsh-theme b/modules/prompt/themes/gitster.zsh-theme index ba88fd2..4a1086a 100644 --- a/modules/prompt/themes/gitster.zsh-theme +++ b/modules/prompt/themes/gitster.zsh-theme @@ -32,7 +32,7 @@ prompt_gitster_setup() { add-zsh-hook precmd prompt_gitster_precmd - zle -N zle-keymap-select + [[ "$ZIM_PROMPT_INSERTMODE" != '' ]] && zle -N zle-keymap-select zstyle ':zim:git-info:branch' format '%b' zstyle ':zim:git-info:commit' format '%c' diff --git a/modules/prompt/themes/magicmace.zsh-theme b/modules/prompt/themes/magicmace.zsh-theme index b58e908..426cf90 100644 --- a/modules/prompt/themes/magicmace.zsh-theme +++ b/modules/prompt/themes/magicmace.zsh-theme @@ -61,6 +61,8 @@ prompt_magicmace_setup() { add-zsh-hook precmd prompt_magicmace_precmd + [[ "$ZIM_PROMPT_INSERTMODE" != '' ]] && zle -N zle-keymap-select + zstyle ':zim:git-info:branch' format '%b' zstyle ':zim:git-info:commit' format '%c...' zstyle ':zim:git-info:dirty' format '*' diff --git a/modules/prompt/themes/steeef.zsh-theme b/modules/prompt/themes/steeef.zsh-theme index 496ec6c..d711499 100644 --- a/modules/prompt/themes/steeef.zsh-theme +++ b/modules/prompt/themes/steeef.zsh-theme @@ -102,7 +102,7 @@ prompt_steeef_setup() { add-zsh-hook preexec steeef_preexec add-zsh-hook chpwd steeef_chpwd add-zsh-hook precmd prompt_steeef_precmd - zle -N zle-keymap-select + [[ "$ZIM_PROMPT_INSERTMODE" != '' ]] && zle -N zle-keymap-select prompt_opts=(cr subst percent) }