lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 0afd755 2/3: Color $prompt distinctively for


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0afd755 2/3: Color $prompt distinctively for the 'vicmd' keymap
Date: Mon, 28 Oct 2019 07:14:04 -0400 (EDT)

branch: master
commit 0afd7552d57fca456dc8ed2d835be2cc02a6c620
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Color $prompt distinctively for the 'vicmd' keymap
---
 gwc/.zshrc | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gwc/.zshrc b/gwc/.zshrc
index 8a0f8d7..580f569 100644
--- a/gwc/.zshrc
+++ b/gwc/.zshrc
@@ -67,7 +67,18 @@ bindkey '^F' history-incremental-search-forward  # emacs 
Ctrl-S
 bindkey '^G' send-break                          # emacs Ctrl-G
 bindkey '^T' push-line                           # emacs Esc-Q
 
-prompt='%d[%?]%(!.#.$)'
+function zle-line-init zle-keymap-select {
+    local local_prompt='%d[%?]%(!.#.$)'
+    if [[ ${KEYMAP} == vicmd ]]; then
+        prompt="%F{yellow}${local_prompt}%f"
+    else
+        prompt="${local_prompt}"
+    fi
+    zle reset-prompt
+}
+
+zle -N zle-line-init
+zle -N zle-keymap-select
 
 HISTSIZE=1000
 SAVEHIST=1000



reply via email to

[Prev in Thread] Current Thread [Next in Thread]