From e42dd83ffbd8e26d3a5bb57db987731ddabf0b20 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 21 Feb 2012 22:54:21 +1300 Subject: Still tweaking bashrc. --- bash/bash_profile | 3 ++- bash/bashrc | 27 +++++++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) (limited to 'bash') diff --git a/bash/bash_profile b/bash/bash_profile index f46d8af5..7f834d4e 100644 --- a/bash/bash_profile +++ b/bash/bash_profile @@ -1,6 +1,6 @@ # If running Bash, source .bashrc. if [ -n "$BASH_VERSION" ]; then - if [ -f "$HOME/.bashrc" ]; then + if [ -e "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi @@ -13,3 +13,4 @@ fi # Environment variables. export LANG=en_NZ.UTF-8 export NCURSES_NO_UTF8_ACS=1 + diff --git a/bash/bashrc b/bash/bashrc index b8d97eed..59e34eb3 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -1,18 +1,33 @@ # Don't do anything if not running interactively. [ -z "$PS1" ] && return -# Don't put duplicate lines in history, and keep plenty of it. +# Keep plenty of history. +unset HISTFILESIZE +HISTSIZE=1000000 + +# Ignore duplicate commands and whitespace in history. HISTCONTROL=ignoreboth -HISTSIZE=5000 -# Append rather than overwrite Bash history. -shopt -s histappend +# Keep the times of the commands in history. +HISTTIMEFORMAT="%F %T " + +# Add all commands to the history immediately. +PROMPT_COMMAND="history -a; history -n" + +# Autocorrect fudged paths in cd calls. +shopt -s cdspell # Update columns and rows if window size changes. shopt -s checkwinsize +# Put multi-line commands onto one line of history. +shopt -s cmdhist + +# Append rather than overwrite Bash history. +shopt -s histappend + # Simple prompt. -PS1='\u@\h:\w\$ ' +PS1="\u@\h:\w\$ " # Use colors for ls and grep, if available. if [ -x /usr/bin/dircolors ]; then @@ -22,7 +37,7 @@ if [ -x /usr/bin/dircolors ]; then fi # Use completion, if available. -if [ -f /etc/bash_completion ]; then +if [ -e /etc/bash_completion ]; then . /etc/bash_completion fi -- cgit v1.2.3