X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=dotfiles%2Fshell%2Fzshrc;h=cc00a537b9f712aa9dc7bfd17041c81b7ab39ea9;hb=884568691143e4e5c50187858f0a6a7262c2d6e3;hp=92d5b02b9a9aa7ae32135fa9c64eeeaaf460920c;hpb=daf1e83f61fe5641f9eaaa655252ba2584b0b0e6;p=shutils.git diff --git a/dotfiles/shell/zshrc b/dotfiles/shell/zshrc index 92d5b02..cc00a53 100644 --- a/dotfiles/shell/zshrc +++ b/dotfiles/shell/zshrc @@ -94,9 +94,9 @@ zstyle ':vcs_info:*' max-exports 1 function setprompt() { # default: " (%s)-[%b|%a]%u%c-" - zstyle ':vcs_info:*' actionformats "${PR_YELLOW}%s:%b|%a${PR_NO_COLOUR} " + zstyle ':vcs_info:*' actionformats "${PR_YELLOW}%s:%b|%a${PR_NO_COLOUR}" # default: " (%s)-[%b]%u%c-" - zstyle ':vcs_info:*' formats "${PR_YELLOW}%s:%b${PR_NO_COLOUR} " + zstyle ':vcs_info:*' formats "${PR_YELLOW}%s:%b${PR_NO_COLOUR}" setopt PROMPT_SUBST PROMPT='%(!.$PR_RED.$PR_GREEN)%n@%m $PR_BLUE%1~ %# $PR_NO_COLOUR' @@ -104,15 +104,24 @@ function setprompt() } setprompt +# Obtain the autofs mountpoints +autofs_mp="" +[ -r /etc/auto.master ] && autofs_mp=$(grep -e "^/" /etc/auto.master) function precmd () { local exitstatus="${?}" - PR_STUFF=" " + PR_STUFF="" if [[ 0 -ne "${exitstatus}" ]] ; then - PR_STUFF="${PR_RED}RET ${exitstatus}${PR_NO_COLOUR}" + PR_STUFF=" ${PR_RED}RET ${exitstatus}${PR_NO_COLOUR}" + fi + + # autofs always complains not being able to mount .hg/ and the like + if echo "$autofs_mp" | grep -qe "^$PWD\s"; then + vcs_info_msg_0_="${PR_YELLOW}[autofs]${PR_NO_COLOUR}" + else + vcs_info fi - vcs_info }