Skip to content

Instantly share code, notes, and snippets.

@matt-blodgett
Last active October 27, 2019 12:41
Show Gist options
  • Save matt-blodgett/9ca94fb07293f0a8accc09087804a383 to your computer and use it in GitHub Desktop.
Save matt-blodgett/9ca94fb07293f0a8accc09087804a383 to your computer and use it in GitHub Desktop.
My .bashrc for Ubuntu 18.04
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
shopt -s checkwinsize
shopt -s histappend
HISTCONTROL=ignoreboth
HISTSIZE=1000
HISTFILESIZE=2000
# Set PS1
case "$TERM" in
xterm-color|*-256color)
PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \[\033[0;36m\]\h \[\033[0;33m\]\w\[\033[0;96m\]$(__git_ps1)\n\[\033[0;32m\]└─\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\] ▶\[\033[0m\] '
;;
*)
PS1="\u@\h:\w\$ "
;;
esac
# Set terminal title
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;\u@\h: \w\a\]$PS1"
;;
esac
# Make less more friendly for non-text input files,
[[ -x /usr/bin/lesspipe ]] && eval "$(SHELL=/bin/sh lesspipe)"
# Alias definitions.
if [[ -f ~/.bash_aliases ]]; then
. ~/.bash_aliases
fi
# Enable color support of ls and also add handy aliases
if [[ -x /usr/bin/dircolors ]]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# Enable programmable completion features
if ! shopt -oq posix; then
if [[ -f /usr/share/bash-completion/bash_completion ]]; then
. /usr/share/bash-completion/bash_completion
elif [[ -f /etc/bash_completion ]]; then
. /etc/bash_completion
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment