From owner-freebsd-git@freebsd.org Fri Dec 4 17:30:35 2015 Return-Path: Delivered-To: freebsd-git@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60B2CA41BE3 for ; Fri, 4 Dec 2015 17:30:35 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AA0A1A45; Fri, 4 Dec 2015 17:30:35 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by ioc74 with SMTP id 74so122872164ioc.2; Fri, 04 Dec 2015 09:30:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=tHJhaniwPk/qWlnG/lFRNRexXnv/LOKTnGhsKcC/wDM=; b=0xMkW9tQWXRZdn2aP0/DSQppdAbc6OSdIVb6DF7tzEOxAe4dqsvxahqWy6AAjN+I5M moYWl3noY56oV4VtFfgWfQQz8iwdEgUVPasCOx5DbKGyO5Fpq91iy+1dSSn4vvHJh6rk QbzIPD5o4VEi2a138DSWdaj6fcB/7D2bPHZl4atfTXdtwN8fOCvNtwovJEvaVaKfcPnl HfVlEgxWqE9sxsRA4xkTDWPktsRY6Cs+6KCP6/tl8SiU+n+muypHVxwjZ++0nyANjbuq ZXALC/7izkz96J349jJmlLwK7uMaHT+4svvaRabyysDDe6CLpdK46qjjJCZtdH1mEvwS LAtA== MIME-Version: 1.0 X-Received: by 10.107.11.23 with SMTP id v23mr17047981ioi.184.1449250234193; Fri, 04 Dec 2015 09:30:34 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.50.152.69 with HTTP; Fri, 4 Dec 2015 09:30:34 -0800 (PST) In-Reply-To: <5794E27D-73D5-4419-9351-52D45A5C7BFF@FreeBSD.org> References: <5794E27D-73D5-4419-9351-52D45A5C7BFF@FreeBSD.org> Date: Fri, 4 Dec 2015 09:30:34 -0800 X-Google-Sender-Auth: SeO4aw2-TqCa5UK9KRUYs2GBAO0 Message-ID: Subject: Re: Put working git branch in shell prompt for bash and zsh? From: Craig Rodrigues To: Bartek Rutkowski Cc: freebsd-git@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 17:30:35 -0000 On Fri, Dec 4, 2015 at 6:22 AM, Bartek Rutkowski wrote: > Check out 'zprezto' ZSH config framework with 'sorin' theme activated, > you'll love it :) > Wow! I love it! Here is what I did: (1) Followed instructions for setting up zprezto at: https://github.com/sorin-ionescu/prezto (2) In $HOME/.zshrc put this line near the top so that zprezto is properly initialzed: source ~/.zprezto/init.zsh After that, when I changed directories into a git checkout, it puts the branch in the prompt like this: https://goo.gl/WfLMdx I didn't like the default prompt, because it was too "busy". So, I did some additional customizations: (3) In $HOME/.zpreztorc , put this line: zstyle ':prezto:module:prompt' theme 'minimal' That's it! Now I can do this: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ~/checkouts =C2=BB cd $HOME/checkouts ~/checkouts =C2=BB pwd /home/rodrigc/checkouts ~/checkouts =C2=BB cd m2crypto checkouts/m2crypto - [setuptools] =C2=BB git branch python3_c * setuptools checkouts/m2crypto - [setuptools] =C2=BB git checkout master Switched to branch 'master' Your branch is up-to-date with 'origin/master'. checkouts/m2crypto - [master] =C2=BB =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D There are a lot of blogs out there for zprezto, so obviously there is more customization that I can do. However, I was able to quickly get the behavior I wanted without too much work. Thanks!! -- Craig