Notes: Software : bash by follower

.bash_profile

In .bash_profile:

    # Keep ALL the things...                                                        
    export HISTFILESIZE=
    export HISTSIZE=

    # Except for multiple duplicate lines in a row                                  
    # and lines starting with a space                                               
    export HISTCONTROL=ignorespace:ignoredups

    # Don't overwrite the history file, append to it.                               
    shopt -s histappend

    # Don't let unescaped exclamation marks lose your command line                  
    # (Mainly encountered with commit messages.)                                    
    shopt -s histreedit

    # Don't attempt tab command completion on an empty line                         
    shopt -s no_empty_cmd_completion

(via here, some other places, reading man bash and guessing.)

Also, to reload the settings without exiting the current session (via here):

    source ~/.bashrc

Or:

    source ~/.bash_profile

With TAB completion:

    # Have TAB cycle through options and shift-tab list them all                    
    #bind '"\t":menu-complete'                                                      
    #bind '"\e[Z":possible-completions' # shift-tab (ctrl-tab requires more effort)

    # Have shift-TAB cycle through completion options                               
    bind '"\e[Z":menu-complete'

.inputrc

In .inputrc:

    # "up/down arrow keys auto search and complete backwards/forwards
    #  based on what's written. If the line is empty, it behaves as normal."
    #  -- <http://news.ycombinator.com/item?id=4839877>
    "\e[B": history-search-forward
    "\e[A": history-search-backward

Also:

    # in the shell: "the `C-x C-r' command re-reads this (.inputrc) init file, thus
    # incorporating any changes that you might have made to it."