[[ -z "$PS1" ]] && return
cd ~
+set -o vi
-# Set favorites
+# Use 'help shopt' to see the documentation for the given options
+shopt -s histappend
+shopt -s nocaseglob
+shopt -s cdspell
+shopt -s autocd
+shopt -s globstar
+
+# Set default programs
export SHELL='bash'
export EDITOR='vim'
export VISUAL='vim'
# Whenever displaying the prompt, write the previous line to disk
export PROMPT_COMMAND="history -a;"
-# Larger bash history
-export HISTFILESIZE=10000;
-export HISTSIZE=5000;
-export HISTCONTROL=ignoreboth:erasedups
+# History control:
+# - ignorespace: lines which begin with a space character are not saved
+# - ignoredups: lines matching the previous history entry are not saved
+# - erasedups: all previous lines matching the current line are removed before
+# the new line is saved
+export HISTCONTROL=ignorespace:ignoredups:erasedups
export HISTIGNORE="ll:ls:cd:cd -:pwd:exit:date:* --help";
+# Unlimited history
+export HISTFILESIZE=
+export HISTSIZE=
+
# colored GCC warnings and errors
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
+++ /dev/null
-# Case-insensitive globbing (used in pathname expansion)
-shopt -s nocaseglob
-
-# Append to the Bash history file, rather than overwriting it
-shopt -s histappend
-
-# Autocorrect typos in path names when using `cd`
-shopt -s cdspell
-
-# Enable some Bash 4 features when possible:
-# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux`
-# * Recursive globbing, e.g. `echo **/*.txt`
-for option in autocd globstar; do
- shopt -s "$option" 2> /dev/null;
-done;
-
-# Don't use ^D to exit
-set -o ignoreeof
-set -o vi
-