Skip to content

Instantly share code, notes, and snippets.

@xgouchet
Last active June 1, 2017 14:03
Show Gist options
  • Save xgouchet/f311b437057feeadf41f to your computer and use it in GitHub Desktop.
Save xgouchet/f311b437057feeadf41f to your computer and use it in GitHub Desktop.
Custom commands and macros to include in a debian .bashrc file
# Configure Git PS1
GIT_PS1_DESCRIBE_STYLE='describe'
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
GIT_PS1_SHOWSTASHSTATE=true
GIT_PS1_SHOWCOLORHINTS=true
GIT_PS1_HIDE_IF_PWD_IGNORED=true
GIT_PS1_SHOWUPSTREAM='legacy'
#GIT_PS1_STATESEPARATOR=' '
pretty_git_ps1() {
__git_ps1 |
sed 's/</∇/' | # upstream ahead
sed 's/>/∆/' | # upstream behind
sed 's/[$]/Σ/' | # sigma = stash available
sed 's/*/δ/' | # delta = dirty files
sed 's/%/¿/' # untracked files
}
# Prompt
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u\[\033[1;37m\]@\[\033[1;36m\]\h\[\033[1;37m\]:\[\033[01;32m\]\w\[\033[01;33m\]$(pretty_git_ps1) \[\033[37m\](\D{%H:%M})\[\033[00m\]\n\[\033[1;36m\]→ \[\033[00m\]'
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
########################################################################
# make sure the default console editor is nano
export EDITOR="nano"
########################################################################
# handle non breaking space in shell
setxkbmap -option "nbsp:none"
# Fortune greeting
fortune -s | cowsay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment