From d4ec9a5f2e2f3461c29495e34464a6c91afc8513 Mon Sep 17 00:00:00 2001 From: bretello Date: Fri, 15 Jan 2021 01:34:10 +0100 Subject: [PATCH] zsh: add visual mode indicator to zsh theme --- brethil_dotfile.sh | 1 + themes/brethil.zsh-theme | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/brethil_dotfile.sh b/brethil_dotfile.sh index afc4fb7..1942126 100755 --- a/brethil_dotfile.sh +++ b/brethil_dotfile.sh @@ -40,6 +40,7 @@ setopt NO_HIST_VERIFY # https://www.xkcd.com/378/ export EDITOR="vim" # if antibody_plugins.txt includes robbyrussell/oh-my-zsh path:plugins/vi-mode, this also sets `bindkey -v` +export VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true # refresh prompt on every mode change # Fix delete (delete! not backspace) key bindkey -a '^[[3~' delete-char diff --git a/themes/brethil.zsh-theme b/themes/brethil.zsh-theme index f50f934..3559112 100644 --- a/themes/brethil.zsh-theme +++ b/themes/brethil.zsh-theme @@ -124,7 +124,9 @@ function ret_status() { echo "$ret_status" } -_PROMPT_PROTO='$(virtualenv_info)$(user_prompt)$(path_prompt)$(git_prompt)$(job_prompt)$(shlvl_prompt)' +export MODE_INDICATOR="%F{255}[%F{9}nav%F{255}]%f" + +_PROMPT_PROTO='$(vi_mode_prompt_info)$(virtualenv_info)$(user_prompt)$(path_prompt)$(git_prompt)$(job_prompt)$(shlvl_prompt)' function prompt_too_long(){ local zero='%([BSUbfksu]|([FK]|){*})'