From da6f38628aa117047c24a552da6731be5a5bd49d Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Date: Mon, 10 Feb 2014 08:27:40 +0100 Subject: bashrc: Let's treat Mercurial as a first-class citizen. --- bashrc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'bashrc') diff --git a/bashrc b/bashrc index 28e3534..5da0304 100644 --- a/bashrc +++ b/bashrc @@ -22,15 +22,21 @@ TERM=xterm-256color export LESS="FSRX" export PAGER=less -# git completion +# git thingies. source $HOME/.gitcompletion.sh -PS1='\u:\w$(__git_ps1 "\[\033[0;32m\]@\[\033[1;32m\]%s\[\033[0m\]\]") $ ' - -# A typo I do a lot... alias gti=git -# hg completion +# hg thingies. source $HOME/.hgcompletion.sh +__hg_branch() { + if [ -d .hg ]; then + local b=`cat .hg/branch` + echo -e "\033[0;32m@\033[1;32m$b\033[0m" + fi +} + +# Setting up PS1. +PS1='\u:\w$(__hg_branch)$(__git_ps1 "\[\033[0;32m\]@\[\033[1;32m\]%s\[\033[0m\]\]") $ ' # Rake completion complete -C $HOME/.rake_completion -o default rake -- cgit v1.2.3