mirror of
https://gitea.blesmrt.net/mikaela/shell-things.git
synced 2024-11-29 06:29:36 +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
|
# 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
16
zshrc
@ -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 "
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user