From 8e51223d861d53048c3d8c339e0578209eb7ca27 Mon Sep 17 00:00:00 2001 From: Thomas Preisner Date: Mon, 10 Jul 2017 03:00:17 +0200 Subject: [PATCH] zsh: history: move relevant setopts into history.zsh Also don't share history between terminals instantly. --- zsh/history.zsh | 20 ++++++++++++++++++++ zsh/setopt.zsh | 12 ------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/zsh/history.zsh b/zsh/history.zsh index 8fa0ca4..57d5612 100644 --- a/zsh/history.zsh +++ b/zsh/history.zsh @@ -1,3 +1,23 @@ +# ===== setopts +# allow multiple terminal sessions to all append to one zsh command history +setopt append_history +# save timestamp of command and duration +setopt extended_history +# add commands as they are typed, don't wait until shell exit +setopt inc_append_history +# when trimming history, lose oldest duplicates first +setopt hist_expire_dups_first +# do not write events to history that are duplicates of previous events +setopt hist_ignore_dups +# do not add command lines to history that start with a space +setopt hist_ignore_space +# when searching history don't display results already cycled through twice +setopt hist_find_no_dups +# remove extra blanks from each command line being added to history +setopt hist_reduce_blanks +# don't execute, just expand history +setopt hist_verify + # ===== History HISTSIZE=1000000 SAVEHIST=1000000 diff --git a/zsh/setopt.zsh b/zsh/setopt.zsh index f2b4a4c..5cfe906 100644 --- a/zsh/setopt.zsh +++ b/zsh/setopt.zsh @@ -10,18 +10,6 @@ setopt cdablevarS # if argument to cd is the name of a parameter whose value is # ===== Expansion and Globbing setopt extended_glob # treat #, ~, and ^ as part of patterns for filename generation -# ===== 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 - # ===== Completion setopt always_to_end # When completing from the middle of a word, move the cursor to the end of the word setopt auto_menu # show completion menu on successive tab press. needs unsetop menu_complete to work