# this is my zsh config. there are many like it, but this one is mine. # https://zsh.sourceforge.io/Intro/intro_3.html # shellcheck shell=bash # export VERBOSE=1 # export DEBUG=1 export DOTFILES="$HOME/.dotfiles" LOCAL_SHARE="$HOME/.local/share" export PATH="$HOME/.local/bin:$DOTFILES/local/bin:$LOCAL_SHARE/nvim/mason/bin:$LOCAL_SHARE/bob/nvim-bin:$LOCAL_SHARE/cargo/bin:/opt/homebrew/bin:/usr/local/bin:$PATH" export SHARED_SCRIPTS_SOURCED=0 source "$DOTFILES/config/shared.sh" source "${XDG_CONFIG_HOME:-$HOME/.config}/asdf-direnv/zshrc" ZSH_COMPDUMP="$XDG_CACHE_HOME/zsh/zcompdump-${SHORT_HOST}-${ZSH_VERSION}" eval "$(oh-my-posh init zsh --config "$DOTFILES/config/omp/own.toml")" load_antidote() { [[ ! -d "$ANTIDOTE_DIR" ]] && { git submodule add \ --name antidote \ --depth=1 \ -f https://github.com/mattmc3/antidote.git "${ANTIDOTE_DIR}" git config -f .gitmodules submodule.antidote.shallow true } zstyle ':antidote:bundle' use-friendly-names 'yes' zsh_plugins=${ANTIDOTE_PLUGINS} [[ -f ${zsh_plugins}.txt ]] || touch ${zsh_plugins}.txt # Lazy-load antidote from its functions directory. FPATH="$ANTIDOTE_DIR/functions:$FPATH" autoload -Uz antidote # Generate a new static file whenever .zsh_plugins.txt is updated. if [[ ! ${zsh_plugins}.zsh -nt ${zsh_plugins}.txt ]]; then antidote bundle <${zsh_plugins}.txt >|${zsh_plugins}.zsh fi # Source your static plugins file. source ${zsh_plugins}.zsh } # Function to load antigen if available load_antigen() { local antigen_zsh_path="$XDG_BIN_HOME/antigen.zsh" # shellcheck source=../../.local/bin/antigen.zsh if [[ -f "$antigen_zsh_path" ]]; then source "$antigen_zsh_path" antigen use oh-my-zsh # Disable ls colors to avoid issues with eza export DISABLE_LS_COLORS=true export ZSH_TMUX_AUTOSTART=false export ZSH_TMUX_CONFIG="$DOTFILES/config/tmux/tmux.conf" export ZSH_TMUX_UNICODE=true export ZSH_TMUX_AUTOQUIT=false export ZSH_TMUX_DEFAULT_SESSION_NAME=main zstyle ':omz:plugins:eza' 'dirs-first' yes zstyle ':omz:plugins:eza' 'git-status' yes zstyle ':omz:plugins:eza' 'icons' yes zstyle ':omz:plugins:eza' 'ls' yes zstyle ':omz:plugins:eza' 'prompt' yes if [[ "$OSTYPE" == darwin* ]]; then zstyle :omz:plugins:ssh-agent keychain yes fi zstyle :omz:plugins:ssh-agent lazy yes zstyle :omz:plugins:ssh-agent quiet yes # nvm zstyle ':omz:plugins:nvm' autoload yes # z, the zsh version export ZSHZ_DATA="$XDG_STATE_HOME/z" antigen bundle z antigen bundle nvm # these should be always available antigen bundle jreese/zsh-titles antigen bundle brew antigen bundle colored-man-pages antigen bundle zsh-users/zsh-completions x-have eza && antigen bundle eza x-have tms && antigen bundle yuki-ycino/tms # this needs to be the last bundle antigen bundle zsh-users/zsh-syntax-highlighting antigen apply fi } # Function to source FZF configuration source_fzf_config() { local fzf_config="${DOTFILES}/config/fzf/fzf.zsh" if [[ -f "$fzf_config" ]]; then # shellcheck source=config/fzf/fzf.zsh source "$fzf_config" fi } # Function to set up tmux window name plugin if tmux is active setup_tmux_window_name_plugin() { if [[ -n "$TMUX" ]]; then local tmux_window_name_plugin="$DOTFILES/config/tmux/plugins/tmux-window-name/scripts/rename_session_windows.py" if [[ -f "$tmux_window_name_plugin" ]]; then tmux_window_name() { ($tmux_window_name_plugin &) } add-zsh-hook chpwd tmux_window_name tmux_window_name fi fi } # load_antigen load_antidote source_fzf_config setup_tmux_window_name_plugin x-have antidot && eval "$(antidot init)" autoload -Uz compinit bashcompinit compinit -d $ZSH_COMPDUMP bashcompinit