]> git.rmz.io Git - dotfiles.git/blobdiff - zsh/lib/prompt.zsh
qutebrowser: bind gl/gr to move between tabs
[dotfiles.git] / zsh / lib / prompt.zsh
index 5b22231800a31b83be9d9870014047b20e6250be..56d702b67f4e9b278fbd420263e6205baaa25068 100644 (file)
@@ -2,15 +2,19 @@
 setopt prompt_subst
 autoload colors; colors;
 
-hostcolor=green
+hostcolor=cyan
 [[ $(hostname) == "tardis" ]]  && hostcolor=red
 
 precmd() {
-  PROMPT='%T $(virtualenv_prompt)%n@%{$fg[$hostcolor]%}%m%(1j. $fg_bold[white]↵%{$fg_bold[red]%}%j.)%{$reset_color%}%-0>..>$(git_prompt_status)%>>
+  PROMPT='%T $(virtualenv_prompt)%n@%{$fg[$hostcolor]%}%m$(jobs_prompt)%-0>..>$(git_prompt_status)%>>
 %(?..%{$fg_bold[white]%}%?)%{$reset_color%}$(vi_prompt_info)%{%(!.$fg[red]❰.$fg[green]❱)%1G%} '
   RPROMPT='%{$fg[green]%}%~%{$reset_color%}'
 }
 
+jobs_prompt() {
+  printf '%s' "%(1j. $fg_bold[white]↵%{$fg_bold[red]%}%j.)%{$reset_color%}"
+}
+
 vi_prompt_info() {
   local vicmd="$fg_bold[green]❰$reset_color%1G"
   local viins="$fg_bold[blue]❱$reset_color%1G"
@@ -58,6 +62,7 @@ git_prompt_status() {
       [[ "$line" == 2\ R[.MTD]\ * ]]      && (( renamed++ ))
 
       # work tree
+      [[ "$line" == 1\ [.MARCT]A\ * ]]    && (( added++ , modified++ ))  # intend-to-add
       [[ "$line" == 1\ [.MARCT]M\ * ]]    && (( modified++ ))
       [[ "$line" == 1\ [.MARCT]D\ * ]]    && (( deleted_wt++ ))
       [[ "$line" == \?\ * ]]              && (( untracked++ ))