aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Bobov <anton@bobov.name>2024-03-06 21:06:52 +0500
committerAnton Bobov <anton@bobov.name>2024-03-29 21:03:02 +0500
commit915cb1b4a47bdba2e7dc744ce8e3b86af9eb2c8d (patch)
treec435ce6b92e1cb412a727661efcce64fabfc88c9
parente0ad5dacefc7a647ad46bcde7c25b7c0f8f35f31 (diff)
[zsh] Update history settings
-rw-r--r--files/.zsh/rc/S10_zshopts38
-rw-r--r--files/.zsh/rc/S50_aliases2
2 files changed, 27 insertions, 13 deletions
diff --git a/files/.zsh/rc/S10_zshopts b/files/.zsh/rc/S10_zshopts
index b086e1d..241eaa9 100644
--- a/files/.zsh/rc/S10_zshopts
+++ b/files/.zsh/rc/S10_zshopts
@@ -5,9 +5,10 @@ fi
autoload -U is-at-least
+# Docs https://zsh.sourceforge.io/Doc/Release/Options.html
+
setopt aliases
setopt all_export
-setopt append_history
setopt auto_cd
setopt auto_list
setopt auto_menu
@@ -27,20 +28,10 @@ setopt no_correct_all
setopt no_emacs
setopt exec
-setopt no_extended_history
setopt hash_cmds
setopt hash_dirs
setopt hash_list_all
-setopt hist_find_no_dups
-setopt hist_ignore_all_dups
-setopt hist_ignore_space
-setopt hist_no_functions
-setopt hist_no_store
-setopt hist_reduce_blanks
-setopt hist_save_no_dups
-setopt hist_verify
-setopt share_history
setopt no_hup
setopt no_ignore_eof
@@ -57,9 +48,30 @@ setopt zle
[ -w "$zsh_cache" ] && HISTFILE=$zsh_cache/history
-HISTSIZE=10000
LISTMAX=1000
REPORTIME=2
-SAVEHIST=10000
+
+# History
+# Based on https://github.com/mattjj/my-oh-my-zsh/blob/master/history.zsh
+
+# Eternal history
+HISTSIZE=100000000
+SAVEHIST=100000000
+
+setopt bang_hist # Treat the '!' character specially during expansion.
+setopt extended_history # Write the history file in the ":start:elapsed;command" format.
+setopt inc_append_history # Write to the history file immediately, not when the shell exits.
+setopt share_history # Share history between all sessions.
+setopt hist_expire_dups_first # Expire duplicate entries first when trimming history.
+setopt hist_ignore_dups # Don't record an entry that was just recorded again.
+setopt hist_ignore_all_dups # Delete old recorded entry if new entry is a duplicate.
+setopt hist_find_no_dups # Do not display a line previously found.
+setopt hist_ignore_space # Don't record an entry starting with a space.
+setopt hist_save_no_dups # Don't write duplicate entries in the history file.
+setopt hist_reduce_blanks # Remove superfluous blanks before recording entry.
+setopt hist_verify # Don't execute immediately upon history expansion.
+setopt hist_beep # Beep when accessing nonexistent history.
+setopt hist_no_functions # Remove function definitions from the history list
+setopt hist_no_store # Remove the history (fc -l) command from the history list when invoked
# vim: et ft=zsh :
diff --git a/files/.zsh/rc/S50_aliases b/files/.zsh/rc/S50_aliases
index c28ee90..570abcc 100644
--- a/files/.zsh/rc/S50_aliases
+++ b/files/.zsh/rc/S50_aliases
@@ -32,6 +32,8 @@ alias sudo='sudo '
alias sudo-path='sudo env "PATH=$PATH"'
alias watch='watch '
+alias -- -="cd -"
+
alias df='df -h'
alias free='free -tm'
alias whois='whois -H'