Skip to content

Instantly share code, notes, and snippets.

@johnbintz
Created July 28, 2010 14:21
Show Gist options
  • Save johnbintz/494662 to your computer and use it in GitHub Desktop.
Save johnbintz/494662 to your computer and use it in GitHub Desktop.
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo " ("${ref#refs/heads/}")"
}
# Install Local Terminal (Incubation) from the Helios Marketplace
# then set an Env variable for your shell for IS_ECLIPSE=yes
# and be sure to do /bin/bash -l, too
if [ "$IS_ECLIPSE" == "yes" ]; then
export PS1="\[\e[0;30m\][\[\e[0;31m\]\u\[\e[0;30m\]@\[\e[0;32m\]\h\[\e[0;30m\]] \[\e[0;30m\]\w\$(parse_git_branch) \$ \[\e[0;30m\]"
else
export PS1="\[\e[0;37m\][\[\e[0;31m\]\u\[\e[1;37m\]@\[\e[0;32m\]\h\[\e[0;37m\]] \[\e[1;37m\]\w\$(parse_git_branch) \$ \[\e[0;37m\]"
fi
PROMPT_COMMAND='echo -ne "\033]0;${HOSTNAME}:${PWD}\007"'
[[ "${TERM}" == "screen" ]] && echo -n -e '\ek'${HOSTNAME%%.*}'\e\'
shell bash
defscrollback 1024
termcapinfo xterm* ti@:te@
termcapinfo xterm 'hs:ts=\E]0;:fs=\007:ds=\E]0;screen\007'
startup_message off
caption always # activates window caption
caption string '%{= wk}[ %{k}%H %{k}][%= %{= wk}%?%-Lw%?%{r}(%{r}%n*%f%t%?(%u)%?%{r})%{k}%?%+Lw%?%?%= %{k}][%{b} %d/%m %{k}%c %{k}]' # good looking window bar
bindkey -k k5 prev # F5 for previous window
bindkey -k k6 next # F6 for next window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment