From 3cf1544df287b05afef6e5b6ed37db46492c1d48 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 10 Feb 2017 00:22:36 +1300 Subject: Improve and correct some comments --- bash/bashrc | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) (limited to 'bash/bashrc') diff --git a/bash/bashrc b/bash/bashrc index 16669adf..b456d966 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -9,9 +9,9 @@ esac # shellcheck disable=SC2128 [ -n "$BASH_VERSINFO" ] && shopt -q restricted_shell && return -# Clear away all aliases; we do this here rather than in $ENV because the ksh -# family of shells relies on aliases to implement certain POSIX utilities like -# fc(1) and type(1) +# Clear away all aliases; we do this here rather than in the $ENV file shared +# between POSIX shells, because ksh relies on aliases to implement certain +# POSIX utilities, like fc(1) and type(1) unalias -a # If ENV is set, source it to get all the POSIX-compatible interactive stuff; @@ -30,61 +30,63 @@ unalias -a # Keep around 32K lines of history in file HISTFILESIZE=$((1 << 15)) -# Ignore duplicate commands and whitespace in history -HISTCONTROL=ignoreboth +# Ignore duplicate commands +HISTCONTROL=ignoredups # Keep the times of the commands in history HISTTIMEFORMAT='%F %T ' -# Use a more compact format for the time builtin's output +# Use a more compact format for the `time` builtin's output TIMEFORMAT='real:%lR user:%lU sys:%lS' -# Autocorrect fudged paths in cd calls +# Correct small errors in directory names given to the `cd` buildtin shopt -s cdspell -# Update the hash table properly +# Check that hashed commands still exist before running them shopt -s checkhash -# Update columns and rows if window size changes +# Update LINES and COLUMNS after each command if necessary shopt -s checkwinsize -# Put multi-line commands onto one line of history +# Put multi-line commands into one history entry shopt -s cmdhist -# Include dotfiles in pattern matching +# Include filenames with leading dots in pattern matching shopt -s dotglob -# Enable advanced pattern matching +# Enable extended globbing: !(foo), ?(bar|baz)... shopt -s extglob -# Append rather than overwrite Bash history +# Append history to $HISTFILE rather than overwriting it shopt -s histappend -# Repeat the line on failed history expansion +# If history expansion fails, reload the command to try again shopt -s histreedit -# Repeat the expanded line on successful history expansion +# Load history expansion result as the next command, don't run them directly shopt -s histverify -# Use Bash's builtin host completion +# Use Bash's builtin hostname completion shopt -s hostcomplete # Don't change newlines to semicolons in history shopt -s lithist -# Don't warn me about new mail all the time +# Don't try to tell me when my mail is read shopt -u mailwarn -# Ignore me if I try to complete an empty line +# Don't complete a Tab press on an empty line with every possible command shopt -s no_empty_cmd_completion # Use programmable completion, if available shopt -s progcomp -# Warn me if I try to shift when there's nothing there +# Warn me if I try to shift nonexistent values off an array shopt -s shift_verbose -# Don't use PATH to find files to source +# Don't search $PATH to find files for the `source` builtin shopt -u sourcepath # These options only exist since Bash 4.0-alpha if ((BASH_VERSINFO[0] >= 4)) ; then - # Autocorrect fudged paths during completion + # Correct small errors in directory names during completion shopt -s dirspell - # Enable double-starring paths + # Allow double-star globs to match files and recursive paths shopt -s globstar - # Warn me about stopped jobs when exiting; only if >=4.1 due to bug + # Warn me about stopped jobs when exiting + # Available since 4.0, but only set it if >=4.1 due to bug: # ((BASH_VERSINFO[1] >= 1)) && shopt -s checkjobs - # Expand variables in directory completion; only available since 4.3 + # Expand variables in directory completion + # Only available since 4.3 ((BASH_VERSINFO[1] >= 3)) && shopt -s direxpand fi -- cgit v1.2.3