mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
92 lines
2.7 KiB
Bash
Executable File
92 lines
2.7 KiB
Bash
Executable File
# this is my zsh config. there are many like it, but this one is mine.
|
|
# shellcheck shell=bash
|
|
|
|
eval "$HOME/.dotfiles/config/shared.sh"
|
|
x-load-configs
|
|
|
|
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$HOME/.local/go/bin:$XDG_DATA_HOME/bob/nvim-bin:$XDG_DATA_HOME/cargo/bin:/opt/homebrew/bin:/usr/local/bin:$PATH"
|
|
|
|
x-have oh-my-posh && {
|
|
eval "$(oh-my-posh init zsh --config "$DOTFILES/config/omp/own.toml")"
|
|
}
|
|
|
|
export COMPLETION_WAITING_DOTS=true
|
|
|
|
if type brew &> /dev/null; then
|
|
eval "$(brew shellenv)"
|
|
FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:${FPATH}"
|
|
fi
|
|
|
|
export ZSH_CUSTOM_COMPLETION_PATH="$XDG_CONFIG_HOME/zsh/completion"
|
|
x-dc "$ZSH_CUSTOM_COMPLETION_PATH"
|
|
|
|
# Add completion scripts to zsh path
|
|
FPATH="$ZSH_CUSTOM_COMPLETION_PATH:$FPATH"
|
|
|
|
# Try to load antigen, if present
|
|
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
|
|
# shellcheck source=../../.local/bin/antigen.zsh
|
|
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
|
|
|
|
# antigen is present
|
|
antigen use oh-my-zsh
|
|
|
|
export ZSH_TMUX_AUTOSTART=true
|
|
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
|
|
|
|
# z, the zsh version
|
|
export ZSHZ_DATA="$XDG_STATE_HOME/z"
|
|
antigen bundle z
|
|
|
|
# these should be always available
|
|
antigen bundle tmux
|
|
antigen bundle colored-man-pages
|
|
antigen bundle ssh-agent
|
|
antigen bundle jreese/zsh-titles
|
|
antigen bundle zsh-users/zsh-completions
|
|
|
|
x-have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
|
|
|
|
# this needs to be the last item
|
|
antigen bundle zsh-users/zsh-syntax-highlighting
|
|
antigen apply
|
|
|
|
# shellcheck source=../config/fzf/fzf.zsh
|
|
[ -f "${DOTFILES}/config/fzf/fzf.zsh" ] \
|
|
&& source "${DOTFILES}/config/fzf/fzf.zsh"
|
|
|
|
x-have pyenv && {
|
|
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
|
|
eval "$(pyenv init -)"
|
|
eval "$(pyenv virtualenv-init -)"
|
|
}
|
|
|
|
# Run only if tmux is active
|
|
[[ -n "$TMUX" ]] && {
|
|
# Autoupdate tmux window name
|
|
TMUX_WINDOW_NAME_PLUGIN="$DOTFILES/config/tmux/plugins/tmux-window-name/scripts/rename_session_windows.py"
|
|
[ -f "$TMUX_WINDOW_NAME_PLUGIN" ] && {
|
|
tmux_window_name()
|
|
{
|
|
($TMUX_WINDOW_NAME_PLUGIN &)
|
|
}
|
|
add-zsh-hook chpwd tmux_window_name
|
|
tmux_window_name
|
|
}
|
|
}
|
|
|
|
x-have antidot && {
|
|
eval "$(antidot init)"
|
|
}
|
|
|
|
# Herd checks for a few environment variables to inject PHP binaries and configurations.
|
|
# Herd injected PHP binary.
|
|
# export PATH="/Users/ivuorinen/Library/Application\ Support/Herd/bin/":$PATH
|
|
# Herd injected PHP 8.3 configuration.
|
|
# export HERD_PHP_83_INI_SCAN_DIR="/Users/ivuorinen/Library/Application\ Support/Herd/config/php/83/"
|
|
# Herd injected PHP 7.4 configuration.
|
|
# export HERD_PHP_74_INI_SCAN_DIR="/Users/ivuorinen/Library/Application\ Support/Herd/config/php/74/"
|