Skip to content

Instantly share code, notes, and snippets.

@ultimaweapon
Last active June 25, 2020 04:48
Show Gist options
  • Save ultimaweapon/be9878b1c3dead272726e1106edaac86 to your computer and use it in GitHub Desktop.
Save ultimaweapon/be9878b1c3dead272726e1106edaac86 to your computer and use it in GitHub Desktop.
My Bash configurations
alias ls='ls --color=auto'
alias ll='ls -hl --group-directories-first'
PROMPT_COMMAND=setup_prompt
setup_prompt() {
exit_code="$?"
PS1="[\[\e[1;34m\]\w\[\e[0m\]:\[\e[1;95m\]${exit_code}\[\e[0m\]]"
if test "$exit_code" != "0"; then
PS1+="\[\e[1;31m\]\$\[\e[0m\] "
else
PS1+="\[\e[1;32m\]\$\[\e[0m\] "
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment