140 lines
3.5 KiB
Bash
Executable file
140 lines
3.5 KiB
Bash
Executable file
# Enable profiling
|
|
# zmodload zsh/zprof
|
|
|
|
# Path to your oh-my-zsh installation
|
|
# export ZSH="$HOME/.oh-my-zsh"
|
|
# export ZSH_CUSTOM="$HOME/.oh-my-zsh/custom"
|
|
# export UPDATE_ZSH_DAYS=1
|
|
|
|
# Add macOS specific command-line utilities
|
|
if [[ -d /usr/local/opt/coreutils/libexec/gnubin && ! "$PATH" =~ (^|:)/usr/local/opt/coreutils/libexec/gnubin(:|$) ]]; then
|
|
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
|
|
fi
|
|
|
|
# Ensure /opt/homebrew is in the PATH if it exists
|
|
if [[ -d /opt/homebrew && ! "$PATH" =~ (^|:)/opt/homebrew/(bin|sbin)($|:) ]]; then
|
|
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH"
|
|
fi
|
|
|
|
# Add /usr/local/bin and /usr/local/sbin to PATH if they are not already present
|
|
dirs=("/usr/local/bin" "/usr/local/sbin")
|
|
for dir in "${dirs[@]}"; do
|
|
if [[ -d $dir && ! "$PATH" =~ (^|:)$dir(:|$) ]]; then
|
|
export PATH="$dir:$PATH"
|
|
fi
|
|
done
|
|
|
|
# Disable auto title
|
|
DISABLE_AUTO_TITLE="true"
|
|
|
|
# Auto-update and other zsh settings
|
|
# DISABLE_UPDATE_PROMPT=true
|
|
# zstyle ':omz:update' mode reminder # remind to update
|
|
|
|
# Uncomment to use case-sensitive completion
|
|
# CASE_SENSITIVE="true"
|
|
|
|
# Uncomment to use hyphen-insensitive completion
|
|
# HYPHEN_INSENSITIVE="true"
|
|
|
|
# Miscellaneous configurations
|
|
# DISABLE_MAGIC_FUNCTIONS="true"
|
|
# DISABLE_LS_COLORS="true"
|
|
# ENABLE_CORRECTION="true"
|
|
# COMPLETION_WAITING_DOTS="true"
|
|
# DISABLE_UNTRACKED_FILES_DIRTY="true"
|
|
|
|
# Load zsh hooks
|
|
# autoload -Uz add-zsh-hook
|
|
|
|
# Load zsh completions
|
|
# autoload -Uz compinit && compinit -C
|
|
|
|
# Plugins to load
|
|
# plugins=(
|
|
# git
|
|
# docker
|
|
# zsh-syntax-highlighting
|
|
# zsh-autosuggestions
|
|
# colored-man-pages
|
|
# macos
|
|
# autoupdate
|
|
# zoxide
|
|
# )
|
|
# export ZSH_AUTOSUGGEST_STRATEGY=(
|
|
# history
|
|
# completion
|
|
# )
|
|
|
|
# Source oh-my-zsh.sh
|
|
# . $ZSH/oh-my-zsh.sh
|
|
|
|
# Load zinit
|
|
export ZINIT_HOME="${ZDOTDIR:-$HOME}/.zinit"
|
|
if [[ ! -d $ZINIT_HOME ]]; then
|
|
git clone https://github.com/zdharma-continuum/zinit $ZINIT_HOME
|
|
fi
|
|
. $ZINIT_HOME/zinit.zsh
|
|
|
|
# Load plugins with zinit
|
|
zinit light zsh-users/zsh-syntax-highlighting
|
|
zinit light zsh-users/zsh-autosuggestions
|
|
zinit light zsh-users/zsh-completions
|
|
zinit light zsh-users/zsh-history-substring-search
|
|
|
|
# zoxide
|
|
zinit ice from"gh-r" as"program" pick"bin/zoxide"
|
|
zinit load ajeetdsouza/zoxide
|
|
|
|
# Load eza completions if needed
|
|
[[ ! "$FPATH" =~ (^|:)${HOME}/.local/bin/eza/completions/zsh(:|$) ]] && export FPATH="$HOME/.local/bin/eza/completions/zsh:$FPATH"
|
|
|
|
# Initialize direnv
|
|
eval "$(direnv hook zsh)"
|
|
|
|
# Initialize zoxide
|
|
eval "$(zoxide init --cmd cd zsh)"
|
|
|
|
# Initialize Starship
|
|
eval "$(starship init zsh)"
|
|
export STARSHIP_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/starship.toml"
|
|
|
|
# >>> conda initialize >>>
|
|
# !! Contents within this block are managed by 'conda init' !!
|
|
__conda_setup="$('/usr/local/Caskroom/miniforge/base/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
|
|
if [ $? -eq 0 ]; then
|
|
eval "$__conda_setup"
|
|
else
|
|
if [ -f "/usr/local/Caskroom/miniforge/base/etc/profile.d/conda.sh" ]; then
|
|
. "/usr/local/Caskroom/miniforge/base/etc/profile.d/conda.sh"
|
|
else
|
|
export PATH="/usr/local/Caskroom/miniforge/base/bin:$PATH"
|
|
fi
|
|
fi
|
|
unset __conda_setup
|
|
# <<< conda initialize <<<
|
|
|
|
# Set default editor
|
|
if [[ -n $SSH_CONNECTION ]]; then
|
|
export EDITOR='vi'
|
|
else
|
|
export EDITOR='nvim'
|
|
fi
|
|
|
|
# Compilation flags
|
|
# export ARCHFLAGS="-arch x86_64"
|
|
|
|
# Custom aliases
|
|
alias python="python3"
|
|
alias grep="grep --color=auto"
|
|
|
|
if [[ -f ~/.local/bin/scripts/check_aliases ]]; then
|
|
. ~/.local/bin/scripts/check_aliases
|
|
fi
|
|
|
|
# Final clean-up of PATH (commented out for speed)
|
|
# path_clean
|
|
|
|
# zprof (commented out for speed)
|
|
# zprof
|
|
|