Skip to content

Instantly share code, notes, and snippets.

@srugano
Last active May 24, 2019 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srugano/748ecd0bf9eb4aa8cd80c389769cf80d to your computer and use it in GitHub Desktop.
Save srugano/748ecd0bf9eb4aa8cd80c389769cf80d to your computer and use it in GitHub Desktop.
Color prompts I use in all my machines
function parse_git_branch {
ref=$(git-symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
PS1="$RED\$(date +%H:%M) \w$YELLOW \$(parse_git_branch)$GREEN[\h]\\$ "
export HISTTIMEFORMAT="%h %d %H:%M:%S "
export HISTCONTROL=ignorespace:erasedups # colon-separated list of value$
export HISTIGNORE="ls:ps:history" # Don’t save ls, ps and history comma$
export EDITOR=nano
export LANGUAGE="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment