mirror of
https://gitea.blesmrt.net/mikaela/shell-things.git
synced 2024-12-22 10:42:55 +01:00
bashrc & zshrc: (almost) unlimited history + time stamps in history
This commit is contained in:
parent
815ee86a4e
commit
64aafd4447
13
bashrc
13
bashrc
@ -21,14 +21,21 @@ fi" > ~/.bash_profile
|
||||
|
||||
# don't put duplicate lines in the history. See bash(1) for more options
|
||||
# ... or force ignoredups and ignorespace
|
||||
HISTCONTROL=ignoredups:ignorespace
|
||||
HISTCONTROL=ignoredups
|
||||
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=1000
|
||||
HISTFILESIZE=2000
|
||||
export HISTSIZE=
|
||||
export HISTFILESIZE=
|
||||
|
||||
export HISTTIMEFORMAT='%F %T '
|
||||
|
||||
HISTFILE=~/.history
|
||||
export APPEND_HISTORY=
|
||||
export SHARE_HISTORY=
|
||||
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
|
16
zshrc
16
zshrc
@ -20,15 +20,18 @@ promptinit
|
||||
PS1="%B%(!.%F{red}.%F{green})%n@%m %~
|
||||
%#%f%b "
|
||||
|
||||
setopt histignorealldups sharehistory
|
||||
setopt histignorealldups sharehistory APPEND_HISTORY SHARE_HISTORY
|
||||
|
||||
# Use emacs keybindings even if our EDITOR is set to vi
|
||||
bindkey -e
|
||||
|
||||
# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
|
||||
HISTSIZE=1000
|
||||
SAVEHIST=1000
|
||||
HISTFILE=~/.zsh_history
|
||||
HISTCONTROL=ignoredups
|
||||
export HISTSIZE=9999999999
|
||||
export HISTFILESIZE=99999999999
|
||||
export HISTTIMEFORMAT='%F %T '
|
||||
HISTFILE=~/.history
|
||||
export APPEND_HISTORY=
|
||||
export SHARE_HISTORY=
|
||||
|
||||
# Use modern completion system
|
||||
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 "
|
||||
|
||||
# For getting timestamps in history
|
||||
alias history="history -i "
|
||||
|
||||
# To have less handle ls colours
|
||||
alias less="less -R "
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user