Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Still tweaking bashrc.

  • Loading branch information...
commit b804d4290188a9c7ee636bad741d34aca9d02983 1 parent 38b60bb
@tejr authored
Showing with 23 additions and 7 deletions.
  1. +2 −1  bash/bash_profile
  2. +21 −6 bash/bashrc
View
3  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
+
View
27 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
Please sign in to comment.
Something went wrong with that request. Please try again.