Fix history and .secrets sourcing

This commit is contained in:
2026-04-21 17:04:34 -05:00
committed by GitHub
parent c5f51d5b3f
commit 4eca393aa9
+18 -11
View File
@@ -5,7 +5,9 @@ fi
# Load local environment secrets if the file exists # Load local environment secrets if the file exists
if [ -f "$HOME/.secrets" ]; then if [ -f "$HOME/.secrets" ]; then
set -a
source "$HOME/.secrets" source "$HOME/.secrets"
set +a
fi fi
############################################### ###############################################
@@ -23,7 +25,7 @@ if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
fi fi
# Add script binaries to $PATH if they exist # Add script binaries to $PATH if they exist
if [[ -d $HOME/.scripts && ":$PATH:" != *":$HOME/.scripts:"* ]]; then if [[ -d $HOME/.scripts && ":$PATH:" != *":$PATH:"* ]]; then
export PATH=$PATH:$HOME/.scripts export PATH=$PATH:$HOME/.scripts
fi fi
@@ -56,7 +58,19 @@ if [[ -d $HOME/.cargo/bin && ":$PATH:" != *":$HOME/.cargo/bin:"* ]]; then
fi fi
############################################### ###############################################
# zsh recommeded default configs # History configuration
###############################################
# Set history variables before options
HISTFILE="$HOME/.zsh_history"
HISTSIZE=10000
SAVEHIST=10000
# Set shell options
setopt histignorealldups sharehistory appendhistory incappendhistory
###############################################
# zsh recommended default configs
############################################### ###############################################
# Autoload functions # Autoload functions
@@ -66,9 +80,6 @@ autoload -Uz compinit
# Initialize prompt system # Initialize prompt system
promptinit promptinit
# Set shell options
setopt histignorealldups sharehistory
# Use emacs keybindings even if EDITOR is set to vi # Use emacs keybindings even if EDITOR is set to vi
bindkey -e bindkey -e
@@ -83,11 +94,6 @@ bindkey "^[[1;5D" backward-word
################################################### ###################################################
# History settings
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh_history
# Initialize completion system # Initialize completion system
compinit compinit
@@ -97,6 +103,7 @@ zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' format 'Completing %d' zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' group-name '' zstyle ':completion:*' group-name ''
zstyle ':completion:*' menu select=2 zstyle ':completion:*' menu select=2
# Directory colors setup # Directory colors setup
if command -v dircolors &> /dev/null; then if command -v dircolors &> /dev/null; then
eval "$(dircolors -b)" eval "$(dircolors -b)"
@@ -141,7 +148,7 @@ fi
# lsd is a rust ls alternative with a lot of features and fun colors/icons (Nerd Fonts required) # lsd is a rust ls alternative with a lot of features and fun colors/icons (Nerd Fonts required)
if command -v lsd &> /dev/null; then if command -v lsd &> /dev/null; then
alias ls="lsd -F" # Add classification to file types alias ls="lsd -F" # Add classification to file types
alias la="lsd -AF" rg alias la="lsd -AF"
alias ll="lsd -lAF" alias ll="lsd -lAF"
alias lg="lsd -F --group-dirs=first" # Group directories first alias lg="lsd -F --group-dirs=first" # Group directories first
alias lt="lsd --tree --depth 5" # Show directory tree with depth of 5 alias lt="lsd --tree --depth 5" # Show directory tree with depth of 5