if [[ $INSIDE_EMACS ]]; then
bind 'set horizontal-scroll-mode on'
bind 'set print-completions-horizontally on'
+ export PAGER=cat
+ export MANPAGER=cat
stty echo
else
stty werase undef lnext undef stop undef start undef
HISTFILESIZE=
# max commands 1 session can append to history
HISTSIZE=100000
+# my history size limit based on lines
+HISTFILELINES=1000000
# this needs to be different from the derault because
# default HISTFILESIZE is 500 and could clobber our history
HISTFILE=$HOME/.bh
HISTTIMEFORMAT="%I:%M %p %m/%d "
-# duplicate, single letter, and space prepended commands do not go in history
-HISTIGNORE="&:?: *"
+# consecutive duplicate lines don't go in history
+HISTIGNORE="&"
export BC_LINE_LENGTH=0
}
+if type ack-grep >/dev/null 2>&1; then
+ alias ack=ack-grep
+fi
+
gr() {
grep -i --binary-files=without-match --color=auto "$@"
if [[ $1 ]]; then
max_lines=$(($1 * 2)) # 2 lines for every history command
else
- max_lines=1000000
+ max_lines=$HISTFILELINES
fi
linecount=$(wc -l < $HISTFILE)
linecount=${linecount:-0}
tempfile=$(mktemp)
[[ $tempfile ]] || { echo mktemp failed; return 1; }
head -$prune_lines $HISTFILE >> ${HISTFILE}a \
- && sed -e "1,${prune_lines}d" $HISTFILE > $tempfile \
- && mv $tempfile $HISTFILE
+ && sed -ie "1,${prune_lines}d" $HISTFILE
fi
perm_fix $HISTFILE
perm_fix ${HISTFILE}_archive
- history -c
- history -r
}
# commands to run when bash exits normally