diff --git a/scripts/reboot.sh b/scripts/reboot.sh index 82c60a1f..60020ce8 100755 --- a/scripts/reboot.sh +++ b/scripts/reboot.sh @@ -1,9 +1,5 @@ #!/bin/bash -if [ -f "$HOME/.zsh_history " ] ; then - rm "$HOME/.zsh_history" -fi - if [ -d "$HOME/.recycle-bin" ] ; then doas rm -r "$HOME/.recycle-bin/" && doas reboot else diff --git a/scripts/shutdown.sh b/scripts/shutdown.sh index b9adad56..338d3dc8 100755 --- a/scripts/shutdown.sh +++ b/scripts/shutdown.sh @@ -1,9 +1,5 @@ #!/bin/bash -if [ -f "$HOME/.zsh_history " ] ; then - rm "$HOME/.zsh_history" -fi - if [ -d "$HOME/.recycle-bin" ] ; then doas rm -r "$HOME/.recycle-bin/" && doas shutdown -h now else diff --git a/zshrc.txt b/zshrc.txt index 2c341360..286065e6 100644 --- a/zshrc.txt +++ b/zshrc.txt @@ -1,12 +1,9 @@ # ~/.zshrc -# + # to change default shell, use chsh -s $(which zsh) -# creates a zsh_history file on startup -touch $HOME/.zsh_history -# # create custom env variables: -export cproj="/home/brian/Documents/Code/source_code_to_study/sandbox/msh" +export cproj="$HOME/Documents/Code/source_code_to_study/sandbox/msh" # custom BROWSER env for ddgr: export BROWSER=links export TUIR_BROWSER=librewolf @@ -24,11 +21,26 @@ export LESS_TERMCAP_us=$'\e[1;4;33m' # Formats history command with dates/times export HISTTIMEFORMAT="%d/%m/%y %T " # Sets default for history command -export HISTSIZE=2000 +export HISTSIZE=10000000 export HISTFILESIZE=100000 export HISTFILE="$HOME/.zsh_history" -export SAVEHIST=$HISTSIZE -setopt hist_ignore_all_dups +SAVEHIST=10000000 + +# 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. + +# creates a .zsh_history file on startup, and clears the history +touch $HISTFILE && cat /dev/null > $HISTFILE && history -p # Configure thefuck eval "$(thefuck --alias)"