1
0
Fork 0
mirror of synced 2024-11-22 15:25:34 -05:00

[history] Remove EXTENDED_HISTORY and INC_APPEND_HISTORY

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
This commit is contained in:
Eric Nielsen 2018-12-08 14:06:22 -05:00
parent b4ae40652d
commit af11392473
2 changed files with 20 additions and 32 deletions

View file

@ -1,26 +1,20 @@
History history
======= =======
Sets sane default history options. Sets sane history options.
History file is set to save in `${ZDOTDIR:-${HOME}}/.zhistory` The history is set to be saved in the `${ZDOTDIR:-${HOME}}/.zhistory` file.
(most likely ~/.zhistory) Zsh options
Zsh Options
----------- -----------
| Option | Effect | * `BANG_HIST` performs csh-style '!' expansion.
| ------ | ------ | * `SHARE_HISTORY` causes all terminals to share the same history 'session'.
| BANG_HIST | Use csh-style '!' expansion | * `HIST_IGNORE_DUPS` does not enter immediate duplicates into the history.
| EXTENDED_HISTORY | Save timestamps along with commands | * `HIST_IGNORE_ALL_DUPS` removes older command from the history if a duplicate is to be added.
| INC_APPEND_HISTORY | Commands are added to the history file immediately upon execution | * `HIST_IGNORE_SPACE` removes commands from the history that begin with a space.
| SHARE_HISTORY | Causes all terminals to share the same history 'session' | * `HIST_SAVE_NO_DUPS` ommits older commands that duplicate newer ones when saving.
| HIST_IGNORE_DUPS | Do not enter immediate duplicates into history | * `HIST_VERIFY` doesn't execute the command directly upon history expansion.
| HIST_IGNORE_ALL_DUPS | If duplicate is to be added, remove older instance in history |
| HIST_IGNORE_SPACE | Do not add any commands to history that begin with a space |
| HIST_SAVE_NO_DUPS | When saving, older commands that duplicate newer commands are omitted |
| HIST_VERIFY | Upon history 'selection', don't execute immediately. Require a carriage return |
Aliases Aliases
------- -------

View file

@ -2,42 +2,36 @@
# Configures history options # Configures history options
# #
# sets the location of the history file # The file to save the history in.
HISTFILE="${ZDOTDIR:-${HOME}}/.zhistory" HISTFILE="${ZDOTDIR:-${HOME}}/.zhistory"
# limit of history entries # The maximum number of events stored in the internal history list and in the history file.
HISTSIZE=10000 HISTSIZE=10000
SAVEHIST=10000 SAVEHIST=10000
# Perform textual history expansion, csh-style, treating the character ! specially. # Perform textual history expansion, csh-style, treating the character ! specially.
setopt BANG_HIST setopt BANG_HIST
# Save each commands beginning timestamp (in seconds since the epoch) and the duration (in seconds) to the history file. # This option both imports new commands from the history file, and also causes your
# : <beginning time>:<elapsed seconds>;<command>. # typed commands to be appended to the history file (like specifying INC_APPEND_HISTORY).
setopt EXTENDED_HISTORY # The history lines are also output with timestamps ala EXTENDED_HISTORY.
# This options works like APPEND_HISTORY except that new history lines are added to the ${HISTFILE} incrementally
# (as soon as they are entered), rather than waiting until the shell exits.
setopt INC_APPEND_HISTORY
# Shares history across all sessions rather than waiting for a new shell invocation to read the history file.
setopt SHARE_HISTORY setopt SHARE_HISTORY
# Do not enter command lines into the history list if they are duplicates of the previous event. # Do not enter command lines into the history list if they are duplicates of the previous event.
setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_DUPS
# If a new command line being added to the history list duplicates an older one, # 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). # the older command is removed from the list (even if it is not the previous event).
setopt HIST_IGNORE_ALL_DUPS setopt HIST_IGNORE_ALL_DUPS
# Remove command lines from the history list when the first character on the line is a space, # Remove command lines from the history list when the first character on the
# or when one of the expanded aliases contains a leading space. # line is a space, or when one of the expanded aliases contains a leading space.
setopt HIST_IGNORE_SPACE setopt HIST_IGNORE_SPACE
# When writing out the history file, older commands that duplicate newer ones are omitted. # When writing out the history file, older commands that duplicate newer ones are omitted.
setopt HIST_SAVE_NO_DUPS setopt HIST_SAVE_NO_DUPS
# Whenever the user enters a line with history expansion, dont execute the line directly; # 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. # instead, perform history expansion and reload the line into the editing buffer.
setopt HIST_VERIFY setopt HIST_VERIFY