]> Sergey Matveev's repositories - dotfiles.git/blobdiff - zsh/.zsh/rc/015prompt.zsh
Let's try command's output selector
[dotfiles.git] / zsh / .zsh / rc / 015prompt.zsh
index 158ce98666ebab0ae1cc19db52e18b8588df6ccf..9a6219ac2396cdc9e7160f3c8e3e4f5c62fb8185 100644 (file)
@@ -1,12 +1,15 @@
 setopt PROMPT_SUBST
 
 PROMPT="%2~ %B"
+# A: autoenv
+# V: virtualenv
+# M: laxed umask
 PROMPT+='${(j::)psvar}'
 PROMPT+="%(1j.%j.)%b"
 PROMPT+='%U${vcs_info_msg_0_}%u'
 PROMPT+="%(?.. %S%?%s)"
 PROMPT+='%(1S. %B${SECONDS}%b.)'
-PROMPT+='%B%F{magenta}%#%f%b '
+PROMPT+='%B%F{magenta}%#%f%b '
 
 function zle-line-init zle-keymap-select {
     local ccolour=red
@@ -18,6 +21,9 @@ function zle-line-init zle-keymap-select {
     [[ -z "$VIRTUAL_ENV" ]] && psvar=(${psvar#V}) || {
         [[ -n "${psvar[(r)V]}" ]] || psvar=(V $psvar)
     }
+    [[ `umask` == "077" ]] && psvar=(${psvar#M}) || {
+        [[ -n "${psvar[(r)M]}" ]] || psvar=("M" $psvar)
+    }
     zle reset-prompt
 }