settings

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 0ba687a10c1bfeb31315be5ef344e1df4ba4a7c2
parent 0d18c60644ed9d6a4c7ae93603eba5d4a69af75e
Author: Paul Longtine <paul@nanner.co>
Date:   Thu Feb 19 01:10:46 2015

updated more

Diffstat:
 zsh/.zshrc | 26 ++++++++++++++++++++++----
 zsh/git.sh | 21 ---------------------
 2 files changed, 22 insertions(+), 25 deletions(-)

diff --git a/zsh/.zshrc b/zsh/.zshrc @@ -1,8 +1,26 @@ # Set up the prompt - -PROMPT=$'%{\e[1;37m%}λ %{\e[0m%}' - -RPS1=$'%{\e[0;33m%}$(~/.local/bin/git.sh) %{\e[0;37m%}%~%{\e[0m%}' +autoload -U colors +colors +autoload -Uz vcs_info + +zstyle ':vcs_info:*' stagedstr '%F{green}+' +zstyle ':vcs_info:*' unstagedstr '%F{red}!' +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:*' enable git + +precmd () { + if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] { + zstyle ':vcs_info:*' formats '%u%c%F{blue} %b%F{white}' + } else { + zstyle ':vcs_info:*' formats '%u%c%F{yellow}?%F{blue} %b%F{white}' + } + vcs_info +} + +setopt prompt_subst + +PROMPT='%{$fg_no_bold[yellow]%}%% %{$reset_color%}' +RPROMPT='${vcs_info_msg_0_}' setopt histignorealldups sharehistory diff --git a/zsh/git.sh b/zsh/git.sh @@ -1,21 +0,0 @@ -#!/bin/bash -function prompt_git() { - local status output flags - status="$(git status 2>/dev/null)" - [[ $? != 0 ]] && return; - output="$(echo "$status" | awk '/# Initial commit/ {print "(init)"}')" - [[ "$output" ]] || output="$(echo "$status" | awk '/# On branch/ {print $4}')" - [[ "$output" ]] || output="$(git branch | perl -ne '/^\* (.*)/ && print $1')" - flags="$( - echo "$status" | awk 'BEGIN {r=""} \ - /Changes to be committed:/ {r=r "+"}\ - /Changes not staged for commit:/ {r=r "!"}\ - /Untracked files:/ {r=r "?"}\ - END {print r}' - )" - if [[ "$flags" ]]; then - output="$flags:$output" - fi - echo "$output" -} -prompt_git