diff options
author | Matt Strapp <matt@mattstrapp.net> | 2024-12-06 09:34:00 -0600 |
---|---|---|
committer | Matt Strapp <matt@mattstrapp.net> | 2024-12-06 09:34:00 -0600 |
commit | 35845dc0c2d291e7a15278ef3f7d79956cbbaf68 (patch) | |
tree | 8c83f2ae84d5af036b891d4b1e01d8e538241b91 /dot_config | |
parent | export (diff) | |
download | dotfiles-35845dc0c2d291e7a15278ef3f7d79956cbbaf68.tar dotfiles-35845dc0c2d291e7a15278ef3f7d79956cbbaf68.tar.gz dotfiles-35845dc0c2d291e7a15278ef3f7d79956cbbaf68.tar.bz2 dotfiles-35845dc0c2d291e7a15278ef3f7d79956cbbaf68.tar.lz dotfiles-35845dc0c2d291e7a15278ef3f7d79956cbbaf68.tar.xz dotfiles-35845dc0c2d291e7a15278ef3f7d79956cbbaf68.tar.zst dotfiles-35845dc0c2d291e7a15278ef3f7d79956cbbaf68.zip |
actually save all the history for real
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to '')
-rw-r--r-- | dot_config/zsh/dot_zshenv | 2 | ||||
-rw-r--r-- | dot_config/zsh/dot_zshrc | 35 | ||||
-rw-r--r-- | dot_config/zsh/executable_dot_zshopts | 25 |
3 files changed, 28 insertions, 34 deletions
diff --git a/dot_config/zsh/dot_zshenv b/dot_config/zsh/dot_zshenv index 47236cf..0f68b72 100644 --- a/dot_config/zsh/dot_zshenv +++ b/dot_config/zsh/dot_zshenv @@ -72,7 +72,7 @@ export PNPM_HOME="$XDG_DATA_HOME"/pnpm #export DENO_INSTALL_ROOT="${XDG_BIN_HOME:-$HOME/.local/bin} export ANSIBLE_CONFIG="$XDG_CONFIG_HOME"/ansible/ansible.cfg export UNISON="$XDG_DATA_HOME"/unison -export HISTFILE="$XDG_DATA_HOME"/history +# export HISTFILE="$XDG_DATA_HOME"/history export WEECHAT_HOME="$XDG_CONFIG_HOME"/weechat export MBSYNCRC="$XDG_CONFIG_HOME"/mbsync/config export ELECTRUMDIR="$XDG_DATA_HOME"/electrum diff --git a/dot_config/zsh/dot_zshrc b/dot_config/zsh/dot_zshrc index 883bf24..350571a 100644 --- a/dot_config/zsh/dot_zshrc +++ b/dot_config/zsh/dot_zshrc @@ -12,6 +12,8 @@ then else ID=$(uname -s) fi + +# Load Powerlevel10k theme case "$ID" in Darwin ) source /usr/local/share/powerlevel10k/powerlevel10k.zsh-theme @@ -33,31 +35,8 @@ fi # Enable colors and change prompt: autoload -U colors && colors # Load colors -setopt autocd # Automatically cd into typed directory. #stty stop undef # Disable ctrl-s to freeze terminal. -setopt interactive_comments -setopt complete_aliases -# History in cache directory: -export HISTSIZE=9999999999 -export SAVEHIST=$HISTSIZE -if [ -z "$XDG_STATE_HOME/zsh" ]; then - mkdir -p "$XDG_STATE_HOME/zsh" -fi -HISTFILE="$XDG_STATE_HOME"/zsh/history -setopt BANG_HIST # Treat the '!' character specially during expansion. -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. # Load aliases and shortcuts if existent. [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/zsh/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/zsh/aliasrc" @@ -72,10 +51,6 @@ zmodload zsh/complist compinit -d ~/.cache/zsh/zcompdump-$ZSH_VERSION _comp_options+=(globdots) # Include hidden files. -# To customize prompt, run `p10k configure` or edit ~/.config/zsh/. p10k.zsh. -[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh -[[ ! -f ~/.config/zsh/keybindings.zsh ]] || source ~/.config/zsh/keybindings.zsh - if [ -n "$WSL_DISTRO_NAME" ] then command_not_found_handler() { @@ -113,4 +88,8 @@ case "$ID" in esac # Windows Terminal stuff -PS1="\[\033]133;D;\007\]\[\033]133;A;\007\]$PS1\[\033]133;B;\007\]"
\ No newline at end of file +PS1="\[\033]133;D;\007\]\[\033]133;A;\007\]$PS1\[\033]133;B;\007\]" + +# To customize prompt, run `p10k configure` or edit ~/.config/zsh/. p10k.zsh. +[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh +[[ ! -f ~/.config/zsh/keybindings.zsh ]] || source ~/.config/zsh/keybindings.zsh
\ No newline at end of file diff --git a/dot_config/zsh/executable_dot_zshopts b/dot_config/zsh/executable_dot_zshopts index 6756bfd..7eaf743 100644 --- a/dot_config/zsh/executable_dot_zshopts +++ b/dot_config/zsh/executable_dot_zshopts @@ -1,7 +1,17 @@ #! /usr/bin/env zsh + +# If you don't plan on reverting to bash, you can remove the link in ~/.profile +# to clean up. + +# create hist directory if it doesn't exist +if [ -z "$XDG_STATE_HOME/zsh" ]; then + mkdir -p "$XDG_STATE_HOME/zsh" +fi + # History settings -HISTSIZE=50000 -SAVEHIST=10000 +HISTSIZE=9999999999 +SAVEHIST=$HISTSIZE +HISTFILE="$XDG_STATE_HOME"/zsh/history setopt append_history # append the history setopt inc_append_history # append to history in the current @@ -18,11 +28,16 @@ setopt hist_find_no_dups # if we find dupes in the history, don't show setopt hist_reduce_blanks # remove blank lines from the command which # mean nothing to the shell +setopt HIST_VERIFY # Don't execute immediately upon history expansion. +setopt BANG_HIST # Treat the '!' character specially during expansion. + +setopt complete_aliases # complete aliases + # Disable this on boxes that are affected by bug # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=924736 # is-at-least 5.5 && unsetopt hist_reduce_blanks # bugfix is incoming, lets see what it does -# is-at-least 5.7.2 && setopt hist_reduce_blanks +is-at-least 5.7.2 && setopt hist_reduce_blanks setopt hist_ignore_space # lines starting with space don't go into the # history @@ -36,7 +51,7 @@ setopt notify # notify when a command returns exit code setopt no_beep # silence..! -#unsetopt auto_cd # disable $ ./bin as cd ./bin +setopt auto_cd # cd to a directory if it's the only argument setopt extendedglob # ls ^bla.* will not show ^bla.txt for example setopt correct # correct incorrent cmd's @@ -66,6 +81,6 @@ setopt auto_name_dirs # foo=/path/to/foo is the same as # hash -d foo=/path/to/foo # Misc -setopt interactivecomments # $ # foo doesn't become an error when hitting +setopt interactive_comments # $ # foo doesn't become an error when hitting # enter |