Last active
September 28, 2025 17:41
-
-
Save GPrimola/186bfa57a55688007b2d4dffc2980c9e to your computer and use it in GitHub Desktop.
zsh history tweaks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # HISTORY | |
| HISTFILE=~/.zsh_history # location of the history file | |
| HISTFILESIZE=1000000000 # history limit of the file on disk (lines) | |
| HISTSIZE=1000000000 # current session's history limit | |
| SAVEHIST=500000 # zsh saves this many lines from the in-memory history list to the history file upon shell exit | |
| HISTTIMEFORMAT="[%F %T]" | |
| setopt EXTENDED_HISTORY # records the time when each command was executed along with the command itself | |
| setopt SHARE_HISTORY # allows multiple Zsh sessions to share the same command history | |
| setopt INC_APPEND_HISTORY # history file is updated immediately after a command is entered | |
| setopt APPENDHISTORY # ensures that each command entered in the current session is appended to the history file immediately after execution | |
| # setopt HIST_IGNORE_SPACE # Do not record an event starting with a space. | |
| # setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history. | |
| # setopt HIST_FIND_NO_DUPS # Do not display a previously found event. | |
| # setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate. | |
| # setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again. | |
| # setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file. | |
| # END HISTORY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment