af11392473
as they are not required (not even recommended) to be set along with `SHARE_HISTORY`. See zshoptions(1) on `SHARE_HISTORY`: > This option ... also causes your typed commands to be appended to the > history file (the latter is like specifying `INC_APPEND_HISTORY`, > which should be turned off if this option is in effect). The history > lines are also output with timestamps ala `EXTENDED_HISTORY` ... Also update copy in comments and in the README. Stick with the following style for the README: * Header 1 with the module name is in `lowercase`. * Other headers are in `Sentence case`. Common header names that should be consistently used are `Aliases`, `Functions`, `Settings`, and `Zsh options`. * The names `Zim` and `Zsh` always appear capitalized, even in the middle of sentences. Closes #313
40 lines
1.5 KiB
Bash
40 lines
1.5 KiB
Bash
#
|
||
# Configures history options
|
||
#
|
||
|
||
# The file to save the history in.
|
||
HISTFILE="${ZDOTDIR:-${HOME}}/.zhistory"
|
||
|
||
# The maximum number of events stored in the internal history list and in the history file.
|
||
HISTSIZE=10000
|
||
SAVEHIST=10000
|
||
|
||
# Perform textual history expansion, csh-style, treating the character ‘!’ specially.
|
||
setopt BANG_HIST
|
||
|
||
# This option both imports new commands from the history file, and also causes your
|
||
# typed commands to be appended to the history file (like specifying INC_APPEND_HISTORY).
|
||
# The history lines are also output with timestamps ala EXTENDED_HISTORY.
|
||
setopt SHARE_HISTORY
|
||
|
||
# Do not enter command lines into the history list if they are duplicates of the previous event.
|
||
setopt HIST_IGNORE_DUPS
|
||
|
||
# If a new command line being added to the history list duplicates an older one,
|
||
# the older command is removed from the list (even if it is not the previous event).
|
||
setopt HIST_IGNORE_ALL_DUPS
|
||
|
||
# Remove command lines from the history list when the first character on the
|
||
# line is a space, or when one of the expanded aliases contains a leading space.
|
||
setopt HIST_IGNORE_SPACE
|
||
|
||
# When writing out the history file, older commands that duplicate newer ones are omitted.
|
||
setopt HIST_SAVE_NO_DUPS
|
||
|
||
# Whenever the user enters a line with history expansion, don't execute the line directly;
|
||
# instead, perform history expansion and reload the line into the editing buffer.
|
||
setopt HIST_VERIFY
|
||
|
||
|
||
# Lists the ten most used commands.
|
||
alias history-stat="history 0 | awk '{print \$2}' | sort | uniq -c | sort -n -r | head"
|