commit 69cfbf6840c61c4ed672622cd67e7c77a66ffd37 (patch) parent 9f18c4dea6ef0a68fa8a1c5be4f340439802a9ba Author: Alexander Karle <akarle@umass.edu> Date: Mon, 14 May 2018 21:01:42 -0400 Adding custom zshrc prompt indicator for Vim modes Diffstat:
M | zshrc | | | 6 | ++++-- |
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/zshrc b/zshrc @@ -9,6 +9,7 @@ ZSH_THEME="refined" plugins=(git zsh-syntax-highlighting docker) source $ZSH/oh-my-zsh.sh +REFINED_PROMPT="$PROMPT" # store the prompt (we append to it for insert/normal mode!) export DEFAULT_USER="$(whoami)" @@ -27,8 +28,9 @@ bindkey -v # bindkey jk vi-cmd-mode function zle-line-init zle-keymap-select { - VIM_PROMPT="%{$fg_bold[yellow]%} [% NORMAL]% %{$reset_color%}" - RPS1="${${KEYMAP/vicmd/$VIM_PROMPT}/(main|viins)/} $EPS1" + VIM_NORMAL_PROMPT="%{$fg_bold[yellow]%}[% N]% %{$reset_color%}" + VIM_INSERT_PROMPT="%{$fg_bold[blue]%}[% I]% %{$reset_color%}" + PS1="${${KEYMAP/vicmd/$VIM_NORMAL_PROMPT}/(main|viins)/$VIM_INSERT_PROMPT} $REFINED_PROMPT" zle reset-prompt }