Disable default zsh history if atuin is present, and only load zsh atuin plugin if atuin is present

This commit is contained in:
TymanWasTaken 2022-08-02 20:22:22 -06:00
parent f91207f4fb
commit 6d09ce9640
No known key found for this signature in database
GPG key ID: CE7836AA83D56858
2 changed files with 12 additions and 7 deletions

View file

@ -7,7 +7,10 @@ zinit light zdharma-continuum/fast-syntax-highlighting; # Syntax highlighting
zinit light zsh-users/zsh-autosuggestions; # Command suggestions zinit light zsh-users/zsh-autosuggestions; # Command suggestions
zinit light Tarrasch/zsh-bd; # bd command zinit light Tarrasch/zsh-bd; # bd command
zinit light zpm-zsh/colorize; # Colorizes a handfull of comands zinit light zpm-zsh/colorize; # Colorizes a handfull of comands
zinit light ellie/atuin; # Better history search
if command -v atuin &> /dev/null; then
zinit light ellie/atuin; # Add atuin (better cmd history) support to zsh
fi
export ZSH_AUTOSUGGEST_STRATEGY=(history completion) # Use history when available, then completion export ZSH_AUTOSUGGEST_STRATEGY=(history completion) # Use history when available, then completion
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh # Load Powerlevel10k config [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh # Load Powerlevel10k config

View file

@ -18,12 +18,14 @@ path+=("$HOME/.cargo/bin")
export PATH export PATH
#--------------------------------------------------------------------------------# #--------------------------------------------------------------------------------#
### Zsh config ### Zsh config
# Configure command history saving # Configure command history saving (if atuin is not found)
if ! command -v atuin &> /dev/null; then
HISTFILE="$HOME/.zsh_history" HISTFILE="$HOME/.zsh_history"
HISTSIZE=500000 HISTSIZE=500000
SAVEHIST=500000 SAVEHIST=500000
setopt INC_APPEND_HISTORY setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY setopt SHARE_HISTORY
fi
# Configure emacs keys # Configure emacs keys
bindkey -e bindkey -e
#---------------------------------------------------------------------------------# #---------------------------------------------------------------------------------#