Skip to content

Commit

Permalink
Wicked history behavior (Thanks Chris Murphy)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmm5t committed Jul 3, 2008
1 parent 28604a5 commit 3bcfe78
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion bashrc
Expand Up @@ -113,9 +113,31 @@ shopt -s extglob
shopt -s checkwinsize

export PAGER="less"
export HISTIGNORE="&:pwd:ls:ll:lal:[bf]g:exit:rm*:sudo rm*"
export EDITOR="vi"

############################################################
## History
############################################################

# When you exit a shell, the history from that session is appended to
# ~/.bash_history. Without this, you might very well lose the history of entire
# sessions (weird that this is not enabled by default).
shopt -s histappend

export HISTIGNORE="&:pwd:ls:ll:lal:[bf]g:exit:rm*:sudo rm*"
# remove duplicates from the history (when a new item is added)
export HISTCONTROL=erasedups
# increase the default size from only 1,000 items
export HISTSIZE=10000

# By default up/down are bound to previous-history and next-history
# respectively. The following does the same but gives the extra functionality
# where if you type any text (or more accurately, if there is any text between
# the start of the line and the cursor), the subset of the history starting with
# that text is searched.
bind '"\e[A"':history-search-backward
bind '"\e[B"':history-search-forward

############################################################
## Aliases
############################################################
Expand Down

0 comments on commit 3bcfe78

Please sign in to comment.