From 71016e2c7f48a7706d7c9c03a35e69f882451d20 Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Mon, 9 Jul 2018 16:12:06 +0200 Subject: [PATCH] Infinite history --- .bashrc | 24 +++++++++++++++++++----- .config/bash/options.sh | 20 -------------------- 2 files changed, 19 insertions(+), 25 deletions(-) delete mode 100644 .config/bash/options.sh diff --git a/.bashrc b/.bashrc index 9fa4183..8cb3282 100644 --- a/.bashrc +++ b/.bashrc @@ -4,8 +4,16 @@ [[ -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' @@ -39,12 +47,18 @@ export GIT_PS1_HIDE_IF_PWD_IGNORED=1 # 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' diff --git a/.config/bash/options.sh b/.config/bash/options.sh deleted file mode 100644 index 9d648a2..0000000 --- a/.config/bash/options.sh +++ /dev/null @@ -1,20 +0,0 @@ -# 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 - -- 2.43.0