<commit_before>## Command history configuration
if [ -z $HISTFILE ]; then
	# Where it gets saved
    HISTFILE=$HOME/.zsh_history
fi

# Erase duplicates in history
export HISTCONTROL=erasedups

# Store 10k history entries
export HISTSIZE=10000
export HISTFILESIZE=$HISTSIZE
# export HISTFILE=$HOME/.zsh_history
export SAVEHIST=$HISTSIZE

# Append to the history file when exiting instead of overwriting it
shopt -s histappend

# Make some commands not show up in history
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"

# Don't overwrite, append!
setopt APPEND_HISTORY
setopt INC_APPEND_HISTORY

setopt APPEND_HISTORY # adds history
setopt HIST_IGNORE_ALL_DUPS  # don't record dupes in history
setopt HIST_REDUCE_BLANKS

setopt EXTENDED_HISTORY # add timestamps to history

setopt HIST_VERIFY

# Killer: share history between multiple shells
setopt SHARE_HISTORY

# If I type cd and then cd again, only save the last one
setopt HIST_IGNORE_DUPS

# Even if there are commands inbetween commands that are the same, still only save the last one
# setopt HIST_IGNORE_ALL_DUPS

setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data



# Write after each command
# setopt INC_APPEND_HISTORY

# Pretty Obvious.  Right?
setopt HIST_REDUCE_BLANKS

# If a line starts with a space, don't save it.
# setopt HIST_IGNORE_SPACE
setopt HIST_NO_STORE

# When using a hist thing, make a newline show the change before executing it.
setopt HIST_VERIFY

# Save the time and how long a command ran
setopt EXTENDED_HISTORY

setopt HIST_SAVE_NO_DUPS
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_FIND_NO_DUPS

# History settings

# Allow use to re-edit a faild history substitution.
shopt -s histreedit
# History expansions will be verified before execution.
shopt -s histverify

# Entries beginning with space aren't added into history, and duplicate
# entries will be erased (leaving the most recent entry).
export HISTCONTROL="ignorespace:erasedups"
# Give history timestamps.
export HISTTIMEFORMAT="[%F %T] "
<commit_msg>Edit zsh history options and environments and add a TODO list<commit_after># TODO:
# Enable setopt HISTTIMEFORMAT?
# Check if SAVEHIST is necessary
# Try INC_APPEND_HISTORY with multiple Terminal windows open
# Check if append_history is necessary even declared inc_append_history
# test hist_no_store option
#   Remove the history (fc -l) command from the history list when invoked.
#   Note that the command lingers in the internal history until the next
#   command is entered before it vanishes, allowing you to briefly reuse or edit the line. 
# Check if HISTTIMEFORMAT is necessary or works with extended history
# Check if is necessary hist_find_no_dups even if hist_ignore_all_dups is set

## Command history configuration
if [ -z $HISTFILE ]; then
  # Where it gets saved
  HISTFILE=$HOME/.zsh_history
fi

# Store 10k history entries
# Reference: http://stackoverflow.com/questions/19454837/bash-histsize-vs-histfilesize)
export HISTSIZE=10000
export HISTFILESIZE=10000

# export HISTFILE=$HOME/.zsh_history
export SAVEHIST=$HISTSIZE

# Make some commands not show up in history
export HISTIGNORE="ls:cd -:pwd:exit:date:* --help"

# Give history timestamps.
export HISTTIMEFORMAT="[%F %T] "

# Zsh options Reference:
# http://linux.die.net/man/1/zshoptions

setopt hist_ignore_all_dups # don't record duplicated commands in history (all = even if it is not the previous event, remove it if undesired behaviour)
setopt hist_reduce_blanks # Remove superfluous blanks from each command line being added to the history list
setopt extended_history # add timestamps to history
setopt hist_verify # When using a hist thing, make a newline show the change before executing it.
# If you find that you want more control over when commands get imported, you may wish to turn SHARE_HISTORY off, INC_APPEND_HISTORY on, and then manually import commands whenever you need them using 'fc -RI'. 
setopt share_history # Killer: share history between multiple shells, if specified it likes inc_append_history and extended_history are set so they are unnecesary check set_local_history zle binding
setopt hist_verify # 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_no_store


# setopt extended_history
# setopt inc_append_history # Don't overwrite history, append! Save every command before it is executed 
{'fraction_non_alphanumeric': 0.04888027562446167, 'fraction_numerical': 0.006029285099052541, 'mean_word_length': 5.294037940379404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3987516', 'n_tokens_mistral': 1436, 'n_tokens_neox': 1372, 'n_words': 570}