]> Sergey Matveev's repositories - dotfiles.git/commitdiff
Change cursor's colour based on vi-mode
authorSergey Matveev <stargrave@stargrave.org>
Mon, 28 Feb 2022 20:27:18 +0000 (23:27 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 28 Feb 2022 20:27:18 +0000 (23:27 +0300)
zsh/.zsh/rc/015prompt.zsh

index 5a0e0b7c6275a2dc4aacc069402d50876a5f48dd..d119a19739111722f47f0832007a5c53a6e739eb 100644 (file)
@@ -6,10 +6,12 @@ PS1+="%(1j.%j.)%b"
 PS1+='%U${vcs_info_msg_0_}%u'
 PS1+="%(?.. %S%?%s)"
 PS1+='%(1S. %B${SECONDS}%b.)'
-PS1+='%B%F{magenta}${_VIMODE}%f%b '
+PS1+='%B%F{magenta}%#%f%b '
 
 function zle-line-init zle-keymap-select {
-    [[ ${KEYMAP} == vicmd ]] && _VIMODE="+" || _VIMODE="%#"
+    printf "\e]12;"
+    [[ ${KEYMAP} == vicmd ]] && printf "red" || printf "green"
+    printf "\e\\"
     [[ "$#_autoenv_stack_entered" -eq 0 ]] && psvar=(${psvar#A}) || {
         [[ -n "${psvar[(r)A]}" ]] || psvar=(A $psvar)
     }