diff --git a/zsh.d/50_history.zsh b/zsh.d/50_history.zsh new file mode 100644 index 0000000..54f909f --- /dev/null +++ b/zsh.d/50_history.zsh @@ -0,0 +1,17 @@ +# vim: ft=zsh + +setopt append_history # Allow multiple terminal sessions to all append to one zsh command history +setopt extended_history # save timestamp of command and duration +setopt inc_append_history # Add comamnds as they are typed, don't wait until shell exit +setopt hist_expire_dups_first # when trimming history, lose oldest duplicates first +setopt hist_ignore_dups # Do not write events to history that are duplicates of previous events +setopt hist_ignore_space # remove command line from history list when first character on the line is a space +setopt hist_find_no_dups # When searching history don't display results already cycled through twice +setopt hist_reduce_blanks # Remove extra blanks from each command line being added to history +setopt hist_verify # don't execute, just expand history +setopt share_history # imports new commands and appends typed commands to history +setopt hist_no_store # remove the history (fc -l) command from the history when invoked. + +export HISTFILE=$HOME/.zsh_history +export HISTSIZE=1000000 +export SAVEHIST=1000000 diff --git a/zshrc b/zshrc index 8d840de..7ce2fda 100644 --- a/zshrc +++ b/zshrc @@ -142,24 +142,6 @@ zle -N predict-off bindkey "^Z" predict-on # C-z bindkey "^X^Z" predict-off # C-x C-z -#---------------------------------- History ----------------------------------- - -setopt append_history # Allow multiple terminal sessions to all append to one zsh command history -setopt extended_history # save timestamp of command and duration -setopt inc_append_history # Add comamnds as they are typed, don't wait until shell exit -setopt hist_expire_dups_first # when trimming history, lose oldest duplicates first -setopt hist_ignore_dups # Do not write events to history that are duplicates of previous events -setopt hist_ignore_space # remove command line from history list when first character on the line is a space -setopt hist_find_no_dups # When searching history don't display results already cycled through twice -setopt hist_reduce_blanks # Remove extra blanks from each command line being added to history -setopt hist_verify # don't execute, just expand history -setopt share_history # imports new commands and appends typed commands to history -setopt hist_no_store # remove the history (fc -l) command from the history when invoked. - -export HISTFILE=~/.zsh_history -export HISTSIZE=1000000 -export SAVEHIST=1000000 - #---------------------------------- Aliases ---------------------------------- # Use interactive sudo instead of su