chore(zshrc): minor re-orders of a few sections

This commit is contained in:
Jim Myhrberg
2024-12-09 10:55:08 +00:00
parent d400b87228
commit e31301d0ff

68
zshrc
View File

@@ -9,6 +9,12 @@ if [[ "$OSTYPE" == "darwin"* ]] && [ -f "/etc/zshrc" ]; then
source "/etc/zshrc" source "/etc/zshrc"
fi fi
# ==============================================================================
# Helper Functions
# ==============================================================================
source "$DOTZSH/zshrc.funcs.zsh"
# ============================================================================== # ==============================================================================
# Zinit # Zinit
# ============================================================================== # ==============================================================================
@@ -36,6 +42,21 @@ source "${ZINIT[BIN_DIR]}/zinit.zsh"
# from the system clipboard. # from the system clipboard.
zinit for @OMZ::lib/clipboard.zsh zinit for @OMZ::lib/clipboard.zsh
# ==============================================================================
# Environment
# ==============================================================================
# Ensure mise shims directory is in PATH so that installed tools are immediately
# available for use within shell initialization. We activate mise normally right
# at end which replaces the shims in PATH with a shell hook that updates PATH as
# needed.
path_prepend "$MISE_HOME/shims"
# If available, make sure to load direnv shell hook before mise.
if command-exists direnv; then
cached-eval "$(command-path direnv)" direnv hook zsh
fi
# ============================================================================== # ==============================================================================
# History # History
# ============================================================================== # ==============================================================================
@@ -203,29 +224,10 @@ autoload -z edit-command-line
zle -N edit-command-line zle -N edit-command-line
bindkey "^X^E" edit-command-line bindkey "^X^E" edit-command-line
# ==============================================================================
# Helper Functions
# ==============================================================================
source "$DOTZSH/zshrc.funcs.zsh"
# ==============================================================================
# Private Dotfiles
# ==============================================================================
if [ -f "$DOTPFILES/zshrc" ]; then
source "$DOTPFILES/zshrc"
fi
# ============================================================================== # ==============================================================================
# Environment and Tool Managers # Environment and Tool Managers
# ============================================================================== # ==============================================================================
# If available, make sure to load direnv shell hook before mise.
if command-exists direnv; then
cached-eval "$(command-path direnv)" direnv hook zsh
fi
MISE_HOME="$HOME/.local/share/mise" MISE_HOME="$HOME/.local/share/mise"
MISE_ZSH_INIT="$MISE_HOME/shell/init.zsh" MISE_ZSH_INIT="$MISE_HOME/shell/init.zsh"
export MISE_INSTALL_PATH="$MISE_HOME/bin/mise" export MISE_INSTALL_PATH="$MISE_HOME/bin/mise"
@@ -237,12 +239,6 @@ fi
if command-exists mise; then if command-exists mise; then
alias mi="mise" alias mi="mise"
# Ensure shims directory is in PATH so that install tools are immediately
# available for use within shell initialization. We activate mise normally
# right at end which replaces the shims in PATH with a shell hook that updates
# PATH as needed.
path_prepend "$MISE_HOME/shims"
setup-completions mise "$MISE_INSTALL_PATH" mise completions zsh setup-completions mise "$MISE_INSTALL_PATH" mise completions zsh
fi fi
@@ -263,6 +259,14 @@ else
echo " install with: mise install starship" >&2 echo " install with: mise install starship" >&2
fi fi
# ==============================================================================
# Private Dotfiles
# ==============================================================================
if [ -f "$DOTPFILES/zshrc" ]; then
source "$DOTPFILES/zshrc"
fi
# ============================================================================== # ==============================================================================
# Tool specific setup # Tool specific setup
# ============================================================================== # ==============================================================================
@@ -312,6 +316,13 @@ unsetopt share_history
# Disable attempted correction of commands (is wrong 98% of the time). # Disable attempted correction of commands (is wrong 98% of the time).
unsetopt correctall unsetopt correctall
# ==============================================================================
# Prepare interactive environment
# ==============================================================================
# Activate mise properly for interactive use not using shims.
eval "$("$MISE_INSTALL_PATH" activate zsh)"
# ============================================================================== # ==============================================================================
# Local Overrides # Local Overrides
# ============================================================================== # ==============================================================================
@@ -321,10 +332,3 @@ if [ -f "$HOME/.zshrc.local" ]; then
fi fi
autoload -U +X bashcompinit && bashcompinit autoload -U +X bashcompinit && bashcompinit
# ==============================================================================
# Prepare interactive environment
# ==============================================================================
# Activate mise properly for interactive use not using shims.
eval "$("$MISE_INSTALL_PATH" activate zsh)"