dotfiles/home/private_dot_config/zsh/dot_zprofile

41 lines
1.1 KiB
Text
Raw Normal View History

2023-08-16 15:21:40 -05:00
#!/usr/bin/env zsh
2023-02-17 09:26:31 -06:00
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
export XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
export XDG_STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-$HOME/.xdg}
for xdgdir in XDG_{CONFIG,CACHE,DATA,STATE}_HOME XDG_RUNTIME_DIR; do
[[ -e ${(P)xdgdir} ]] || mkdir -p ${(P)xdgdir}
done
# Ensure path arrays do not contain duplicates.
2023-08-16 15:21:40 -05:00
typeset -gU path fpath cdpath
2023-02-17 09:26:31 -06:00
# Set the list of directories that zsh searches for commands.
path=(
$HOME/{,.local/}{,s}bin(N)
2023-02-23 14:30:40 -06:00
$HOME/.extra/bin(N)
2023-08-25 09:20:52 -05:00
$HOME/{.go,.cargo,.pyenv}/bin(N)
2023-09-08 10:35:19 -05:00
$HOME/.zig(N)
2023-02-23 14:30:40 -06:00
/opt/local/{,s}bin(N)
2023-02-17 09:26:31 -06:00
/usr/{,local/}{,s}bin(N)
2023-02-23 14:30:40 -06:00
2023-02-17 09:26:31 -06:00
$path
)
2023-02-20 14:26:36 -06:00
# start by sourcing extras
2023-05-04 12:26:29 -05:00
for rcfile in $ZDOTDIR/.extras/{current,shared}/*.{,z}sh(N); do
2023-02-20 14:26:36 -06:00
source $rcfile
done
2023-02-17 09:26:31 -06:00
# Set default less options.
export LESS="${LESS:--g -i -M -R -S -w -z-4}"
# Use `< file` to quickly view the contents of any file.
[[ -z "$READNULLCMD" ]] || READNULLCMD=$PAGER