zsh: Whitespace editing
authorStefan Huber <shuber@sthu.org>
Wed, 10 Feb 2021 20:58:49 +0000 (21:58 +0100)
committerStefan Huber <shuber@sthu.org>
Wed, 10 Feb 2021 20:58:49 +0000 (21:58 +0100)
dotfiles/shell/.zshrc

index 1b74f6d744e6eae18087b4cdba35707f374e5e39..4e135a9b9afe9771409c884244f759a7df7cd116 100644 (file)
@@ -14,7 +14,7 @@ zstyle ':completion::complete:*' use-cache 1
 
 autoload colors zsh/terminfo
 if [[ "$terminfo[colors]" -ge 8 ]]; then
-       colors
+    colors
 fi
 
 eval `dircolors`
@@ -54,14 +54,14 @@ bindkey "\e[8~" end-of-line
 
 
 setopt \
-       EXTENDEDGLOB \
-       BASH_AUTO_LIST \
-       LIST_AMBIGUOUS \
-       CHECK_JOBS \
-       INC_APPEND_HISTORY \
-       HIST_IGNORE_DUPS \
-       HIST_IGNORE_SPACE \
-       NO_HUP
+    EXTENDEDGLOB \
+    BASH_AUTO_LIST \
+    LIST_AMBIGUOUS \
+    CHECK_JOBS \
+    INC_APPEND_HISTORY \
+    HIST_IGNORE_DUPS \
+    HIST_IGNORE_SPACE \
+    NO_HUP
 
 
 HISTFILE=~/.zsh_history
@@ -78,13 +78,13 @@ zstyle ':vcs_info:*' max-exports 1
 
 function setprompt()
 {
-       # default: " (%s)-[%b|%a]%u%c-"
-       zstyle ':vcs_info:*' actionformats "  %s: %b|%a"
-       # default: " (%s)-[%b]%u%c-"
-       zstyle ':vcs_info:*' formats       "  %s: %b"
+    # default: " (%s)-[%b|%a]%u%c-"
+    zstyle ':vcs_info:*' actionformats "  %s: %b|%a"
+    # default: " (%s)-[%b]%u%c-"
+    zstyle ':vcs_info:*' formats       "  %s: %b"
 
-       setopt PROMPT_SUBST
-       PROMPT='
+    setopt PROMPT_SUBST
+    PROMPT='
 %(!.%{$fg_bold[red]%}.%{$fg_bold[green]%})%n@%m%{$reset_color%}$PR_SCREEN$PR_JOBS%{$fg_bold[yellow]%}${vcs_info_msg_0_}%{$reset_color%}  %{$fg_bold[blue]%}%~%{$reset_color%}
 $PR_EXIT%# '
 }
@@ -96,7 +96,7 @@ autofs_mp=()
 
 function precmd ()
 {
-       PR_EXIT="%{$fg_bold[red]%}%(?..[%?] )%{$reset_color%}"
+    PR_EXIT="%{$fg_bold[red]%}%(?..[%?] )%{$reset_color%}"
 
     # Check whether current directory is a subdirectory of an autofs mountpoint
     local parent="0"
@@ -107,11 +107,12 @@ function precmd ()
             parent="1"
             # Even equal!
             if echo "$mp" | /bin/grep -q $PWD; then
-                       vcs_info_msg_0_=" [autofs]"
+                vcs_info_msg_0_=" [autofs]"
             fi
             break;
         fi
     done
+
     if [ -z "$vcs_info_msg_0_" ]; then
         if [ "$parent" = "1" ]; then
             # svn and hg cause complaints of autofs that .svn and .hg is no mount point
@@ -119,20 +120,17 @@ function precmd ()
         else
             zstyle ':vcs_info:*' enable git cvs svn hg
         fi
-               vcs_info
+        vcs_info
     fi
 
-       PR_SCREEN=""
-       if [[ -n "${WINDOW}" ]]; then
-               PR_SCREEN=" S:${WINDOW}"
-       fi
+    PR_SCREEN=""
+    if [[ -n "${WINDOW}" ]]; then
+        PR_SCREEN=" S:${WINDOW}"
+    fi
 
-       PR_JOBS=""
-       if [[ $(jobs | wc -l) -gt 0 ]]; then
-               PR_JOBS=" J:%j"
-       fi
+    PR_JOBS=""
+    if [[ $(jobs | wc -l) -gt 0 ]]; then
+        PR_JOBS=" J:%j"
+    fi
 
 }
-
-
-