## Fancy highlighting in some terminals.
local bold unbold nl gitcolour rccolour uncolour
- local host dir
- bold="" unbold="" nl="" gitcolour="" rccolour="" uncolour=""
+ local host dir more
+ bold="" unbold="" nl="" gitcolour="" rccolour="" uncolour="" more=""
__mdw_set_prompt_hacks
## Choose the right delimiters. Highlight root prompts specially;
*) sec_l="" sec_r=""
esac
- ## If this is an schroot environment then point this out.
+ ## If this is an schroot environment or some other interesting augmented
+ ## environment then point this out.
hqual="$hqual${SCHROOT_CHROOT_NAME+/$SCHROOT_CHROOT_NAME}"
+ hqual="$hqual${MDW_BUILDENV+/$MDW_BUILDENV}"
## Put together the main pieces.
__mdw_prompt_left="$nl$bold$left$sec_l$u$host$hqual$sec_r$dir"
__mdw_prompt_rc_left="$unbold$rccolour"
__mdw_prompt_rc_right="$uncolour$bold"
__mdw_prompt_right="$right$unbold"
+ __mdw_prompt_more=" $more$bold>$unbold "
}
__mdw_set_prompt () {
*) rc="$__mdw_prompt_rc_left rc=$__mdw_last_rc$__mdw_prompt_rc_right" ;;
esac
PS1="$__mdw_prompt_left$git$rc$__mdw_prompt_right"
- PS2="$PS1 $bold>$unbold "
+ PS2="$PS1$__mdw_prompt_more"
unset __mdw_last_rc
;;
esac
alias e="$EDITOR"
alias svn="svnwrap svn"
alias @="ssh"
+alias make="nice make"
+alias gdb="gdb -q"
###--------------------------------------------------------------------------
### Colour output.
alias fgrep="greplike fgrep"
alias zgrep="greplike zgrep"
+## Arrange for `diff' output to be in colour.
+export DIFF_COLORS="hd=1:ln=36:ad=32:de=31"
+difflike () {
+ local diff=$1; shift
+ if [ -t 1 ]; then
+ command $diff \
+ ${DIFF_COLORS+--color=always} \
+ ${DIFF_COLORS+--palette="$DIFF_COLORS"} \
+ "$@" | mdw-pager
+ else
+ command $diff "$@" | cat
+ fi
+}
+alias diff="difflike diff"
+
###--------------------------------------------------------------------------
### Other hacks.