bashrc & zshrc: (almost) unlimited history + time stamps in history

This commit is contained in:
Mika Suomalainen 2012-12-31 23:00:59 +02:00
parent 815ee86a4e
commit 64aafd4447
2 changed files with 21 additions and 8 deletions

13
bashrc
View File

@ -21,14 +21,21 @@ fi" > ~/.bash_profile
# don't put duplicate lines in the history. See bash(1) for more options # don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace # ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace HISTCONTROL=ignoredups
# append to the history file, don't overwrite it # append to the history file, don't overwrite it
shopt -s histappend shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000 export HISTSIZE=
HISTFILESIZE=2000 export HISTFILESIZE=
export HISTTIMEFORMAT='%F %T '
HISTFILE=~/.history
export APPEND_HISTORY=
export SHARE_HISTORY=
# check the window size after each command and, if necessary, # check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS. # update the values of LINES and COLUMNS.

16
zshrc
View File

@ -20,15 +20,18 @@ promptinit
PS1="%B%(!.%F{red}.%F{green})%n@%m %~ PS1="%B%(!.%F{red}.%F{green})%n@%m %~
%#%f%b " %#%f%b "
setopt histignorealldups sharehistory setopt histignorealldups sharehistory APPEND_HISTORY SHARE_HISTORY
# Use emacs keybindings even if our EDITOR is set to vi # Use emacs keybindings even if our EDITOR is set to vi
bindkey -e bindkey -e
# Keep 1000 lines of history within the shell and save it to ~/.zsh_history: HISTCONTROL=ignoredups
HISTSIZE=1000 export HISTSIZE=9999999999
SAVEHIST=1000 export HISTFILESIZE=99999999999
HISTFILE=~/.zsh_history export HISTTIMEFORMAT='%F %T '
HISTFILE=~/.history
export APPEND_HISTORY=
export SHARE_HISTORY=
# Use modern completion system # Use modern completion system
autoload -Uz compinit autoload -Uz compinit
@ -351,6 +354,9 @@ alias ex-tarbz2="tar xfvj "
alias info="echo 'I don't know anyone who likes and uses info pages, so I aliased this to pinfo. If you don't have it installed, you should install it! To override this alias run: \info <document>' && pinfo " alias info="echo 'I don't know anyone who likes and uses info pages, so I aliased this to pinfo. If you don't have it installed, you should install it! To override this alias run: \info <document>' && pinfo "
# For getting timestamps in history
alias history="history -i "
# To have less handle ls colours # To have less handle ls colours
alias less="less -R " alias less="less -R "