From 6d09ce96408714336d000b99b47081269b0d6ea3 Mon Sep 17 00:00:00 2001 From: TymanWasTaken Date: Tue, 2 Aug 2022 20:22:22 -0600 Subject: [PATCH] Disable default zsh history if atuin is present, and only load zsh atuin plugin if atuin is present --- dotfiles/.zinit.zsh | 5 ++++- dotfiles/.zshrc | 14 ++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/dotfiles/.zinit.zsh b/dotfiles/.zinit.zsh index 4ca100a..6b6ddfc 100644 --- a/dotfiles/.zinit.zsh +++ b/dotfiles/.zinit.zsh @@ -7,7 +7,10 @@ zinit light zdharma-continuum/fast-syntax-highlighting; # Syntax highlighting zinit light zsh-users/zsh-autosuggestions; # Command suggestions zinit light Tarrasch/zsh-bd; # bd command 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 [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh # Load Powerlevel10k config diff --git a/dotfiles/.zshrc b/dotfiles/.zshrc index 0d1c98b..aaf506b 100644 --- a/dotfiles/.zshrc +++ b/dotfiles/.zshrc @@ -18,12 +18,14 @@ path+=("$HOME/.cargo/bin") export PATH #--------------------------------------------------------------------------------# ### Zsh config -# Configure command history saving -HISTFILE="$HOME/.zsh_history" -HISTSIZE=500000 -SAVEHIST=500000 -setopt INC_APPEND_HISTORY -setopt SHARE_HISTORY +# Configure command history saving (if atuin is not found) +if ! command -v atuin &> /dev/null; then + HISTFILE="$HOME/.zsh_history" + HISTSIZE=500000 + SAVEHIST=500000 + setopt INC_APPEND_HISTORY + setopt SHARE_HISTORY +fi # Configure emacs keys bindkey -e #---------------------------------------------------------------------------------#